|
Re: choice child under all [message #998518 is a reply to message #998376] |
Thu, 10 January 2013 06:48 |
Ed Merks Messages: 33264 Registered: July 2009 |
Senior Member |
|
|
Steve,
Comments below.
On 10/01/2013 4:27 AM, Steve Prescott wrote:
> I have only done a couple XSD files, but here are two things I can't
> figure out.
>
> I need an item that doesn't care what order its items are int
> <xs:all>. But it also has a <xs:choice> grouping directly under it. A
> <xs:choice> is allowed as a child of <xs:sequence> but not for <xs:all>
Yes, <all> is quite restrictive in what's allowed; essentially just a
set of elements... What you describe doesn't sound expressible in XML
Schema 1.0.
>
> (See attachment but try making the sequence an all)
I don't see attachments...
>
> Second, how do you make an attribute optional?
use="optional"
>
> (See attachment but I want the role to be optional)
>
> The XML for this already exists, and I am trying to make an XSD for it.
Note that EMF will not validate the order of elements in a sequence, it
will accept then in any order (much like it does for attributes where
there is no order constraint). It will then serialize them in the order
in which they're defined in the model (corresponding to the sequence
order if it's schema derived).
>
> <sample name="e1">
> <label>first item</label>
> <int-option value="5" />
> </sample>
>
> <sample name="e2" role="2">
> <float-option value="2.5" />
> <label>second item</label>
> </sample>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03266 seconds