Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


specify element type depending of same element attribute value?

From: "Crni Gorac" <cgorac@-----.--->
To: xmlschema-dev@--.---
Date: 5/11/2006 8:00:00 PM
Am trying to define schema for a not particularly complicated XML
input format.  However, I don't have much prior experience with XML
and schemas in particular, thus even simple stuff (and I guess is
simple because I know it would be trivial to define alike parts of
grammar if flat text format used instead of XML and lex/yacc employed
for parsing) looks complicated to me.  So I'd appreciate any kind of
help that this list could offer.  First problem is related to case
when type of contents of a simple element (not containing nested
element) is determined by this element attribute value.  Let's say
that we have a bag of apples and a bag of oranges and that we want to
select some apples and some oranges from these bags; and that it's
possible to select either all of items from given bag or items with
given indices or items with indices up to given index.  So some
combinations in corresponding XML file would be:
  <apples type="all"/>
  <oranges type="given"/>0 1 3 5 10</oranges>
or say:
  <apples type="upto"/>7</apples>
  <oranges type="given"/>1 2 3</oranges>
I know I need to use nonNegativeInteger for type of contents when
"upto" value of "type" attribute specified and then to use list of
nonNegativeInteger-s when when "max" value of "type" attribute; I know
also how to specify element with attribute only in XML schema for case
when "all" value of "type" attribute used.  But I'm not able to figure
out how to compose all of this into full specification of described
complex element type...

Thanks.


From mike@s... Fri May 12 20:43:15 2006
Received: from maggie.w


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent