[
Lists Home |
Date Index |
Thread Index
]
No, this kind of thing isn't possible in XML schema.
For this kind of constraint you need something like Schematron.
Or write an XSLT stylesheet to do the validation that XML Schema can't do.
Michael Kay
http://www.saxonica.com/
> -----Original Message-----
> From: Paul Popiel [mailto:PaulP@advancedengine.com]
> Sent: 31 May 2005 08:35
> To: 'xml-dev@lists.xml.org'
> Subject: [xml-dev] defining dynamic sized tables in XML schema
>
> 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 Popiel
> Software Engineer
>
> Advanced Engine Components Limited
> 14 Energy St, Malaga WA 6090
> Fax: +61 8 9209 6999
> Mob: 0412 657 051
> mailto:paulp@advancedengine.com
> http://www.advancedengine.com
>
>
>
> **********************************************************************
> This email is confidential. If you are not the intended recipient,
> you must not copy, distribute, disclose or otherwise use the
> information contained in it. If you have received this email in
> error, please tell us immediately by return email or by contacting
> us on (+61 8) 9209 6900 and delete the document. Email may
> be susceptible to data corruption, interception and unauthorised
> amendment. Advanced Engine Components Ltd is not
> responsible for any changes made to a document other than
> those made by Advanced Engine Components Ltd, or for the
> effect of the changes on the document's meaning.
>
> You must scan this email and any attachments for viruses.
> Advanced Engine Components Ltd accepts no liability for any
> loss, damage or consequence, whether caused by our own
> negligence or not, resulting directly or indirectly from your
> receipt of this email or the use of any attachments.
> **********************************************************************
>
> -----------------------------------------------------------------
> The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
> initiative of OASIS <http://www.oasis-open.org>
>
> The list archives are at http://lists.xml.org/archives/xml-dev/
>
> To subscribe or unsubscribe from this list use the subscription
> manager: <http://www.oasis-open.org/mlmanage/index.php>
>
>
|