[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Schema constructs


xsd element mandatory
You could, of course, simply declare the "tag" element mandatory, and
the others optional - but I believe you're looking for a more
"controlled" structure than that (i.e. regarding the sets of elements
that follow "tag"). You could use substitution groups by declaring the
"tag" element mandatory and then following it with a more "general"
element (the head element) that acts as a placeholder - but this would
only work for substituting individual elements, not sets of elements.

Best bet is to define an abstract type for the "modify" content model
with the "tag" element declared as mandatory, and non-abstract types
that derive from the abstract that extend it with the sets of elements
that follow the "tag" element in each required case.

Hope that helps.

Kind Regards,
Joe Chiusano
Booz | Allen | Hamilton
Strategy and Technology Consultants to the World

"James, David" wrote:
> 
> Joe
> 
> > What error message are you getting? (I'm thinking the issue might be
> > non-determinism)
> 
> I am trying to define an element as
> 
> <xsd:element name="modify">
>   <xsd:complexType>
>     <xsd:sequence>
>       <xsd:element ref="tag"/>
>       <xsd:all minOccurs="0">
>         <xsd:element ref="lowscale"/>
>       </xsd:all>
>     </xsd:sequence>
>   </xsd:complexType>
> </xsd:element>
> 
> and xsv is telling me that 'all' is not allowed at that point. This is
> consistent with the primer saying that 'all' can only exist at the top level
> but I can't see how to specify that the element "tag" is always first,
> followed by one or more elements such as "lowscale" (for simplicity the only
> one that I have included).
> 
> Regards,
> David
> 
>   ------------------------------------------------------------------------
> 
>    Part 1.2    Type: application/ms-tnef
>            Encoding: base64

-- 
Kind Regards,
Joseph Chiusano
Associate
Booz | Allen | Hamilton

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.