defining dynamic sized tables in XML schema...

O

obsolete_5

is it possible?

more specifically, a simple example:

i want a 'table' element to have a sequence of 'entry' elements.
i know you can use minOccur = maxOccur = x, to enforce table to have x
entry elements in it.

but this x value needs to be hardcoded in the schema.

what if i had another attribute in the element 'table' called num_rows.

is there anyway to reference or link the num_rows attribute to either
the minOccur or maxOccur properties
OR
is there anyway to use restrictions and facets

in order to define the number of entry elements i want?

so the schema encompasses all sizes of table in one schema definition,
based on the value put into the num_rows attribute for an instance of
the table element, rather then having multiple schema definition for
different sizes


hope that made some sense, ive been trying to figure this out for a few
hrs now, thinking of key contraints, restrictions, minOccur maxOccur
etc etc... dont know if im missing something or if it simply isnt
possible in XML schema

thanks in advance for any help

paul
 
M

Martin Honnen

is it possible?

more specifically, a simple example:

i want a 'table' element to have a sequence of 'entry' elements.
i know you can use minOccur = maxOccur = x, to enforce table to have x
entry elements in it.

but this x value needs to be hardcoded in the schema.

what if i had another attribute in the element 'table' called num_rows.

is there anyway to reference or link the num_rows attribute to either
the minOccur or maxOccur properties

No, you cannot constraint the value of maxOccurs or minOccurs by the
value of another attribute in the XML instance document.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top