Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


elements with different occurance limits

From: John Didion <johndidion@-----.--->
To: xmlschema-dev@--.---
Date: 9/19/2006 2:38:00 AM
I have a complex type...let's call it Foo. Foo
potentially has five child elements:

A and B, each of which MUST appear once
C, D, and E, each of which MAY appear any number of
times, but one of which MUST appear at least once

My first instinct was to write this as an all:

<xs:all>
<xs:element name="A"/>
<xs:element name="B"/>
<xs:choice minOccurs="1" maxOccurs="unbounded">
<xs:element name="C"/>
<xs:element name="D"/>
<xs:element name="E"/>
</xs:choice>
</xs:all>

But of cource, all doesn't allow any element to appear
more than once. I also tried writing this as a big
choice block, with sequences for each of the possible
ways these elements could be ordered, but the parser
complained about potential ambiguity.

Here is the element definition from the DTD that I'm
trying to convert to XSD:

<!ELEMENT MSGSETLIST (
( ( ( SIGNONMSGSET, PROFMSGSET ) | ( PROFMSGSET,
SIGNONMSGSET ) ), ( %MSGSETMACRO; )+ ) |
( ( ( SIGNONMSGSET, ( %MSGSETMACRO; )+, PROFMSGSET ) |
( PROFMSGSET, ( %MSGSETMACRO; )+, SIGNONMSGSET ) ), (
%MSGSETMACRO; )* ) |
( (%MSGSETMACRO;)+, ( ( SIGNONMSGSET, ( %MSGSETMACRO;
)*, PROFMSGSET ) |
( PROFMSGSET, ( %MSGSETMACRO; )*, SIGNONMSGSET ) ), (
%MSGSETMACRO; )* )
)>

Thanks in advance for your help!

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


From noah_mendelsohn@u... Wed Sep 20 12:21:53 2006
Received: from maggie.w3.org


transparent
Print
Mail
Like It
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