Search the web
Sign In
New User? Sign Up
RSS2-Support
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Schemas: update   Message List  
Reply | Forward Message #220 of 807 |
Re: [RSS2-Support] Re: Schemas: update

On Sun, 26 Jan 2003 14:58:57 -0800, in szf you wrote:

>>In doing so, the <sequence> forces the children to be in that specific order.
The RSS document I've been using as an example (yesterday's Scripting News)
doesn't seem to have the <channel> child elements in any particular order, nor
is it mandated by the spec. <sequence> can't be used that way, it won't validate
unless the order is specific.
>>
>>Only <all> can be used to make an arbitrary child order and <all> can't take
any elements other than <element>. Can't use <choice> in it.
>
>the sequence only contains the choice, the choice is set to have
>maxOccurs="unbounded", so that in effect you end up with any number of
>elements from within the choice. I'm obviously not explaining this
>very well, i'll post a sample (after the game, go Raiders!)
>
>Cheers
>Simon

Given this schema

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xs:element name="foo">
<xs:complexType>
<xs:sequence>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="a"/>
<xs:element name="b"/>
<xs:element name="c"/>
<xs:element name="d"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

The following instance doc is valid (verified with XMLSpy 4.4)
<foo>
<a></a>
<c/>
<c/>
<c/>
<d/>
<a/>
</foo>

Which i believe is what you were looking for.

Cheers
Simon
www.pocketsoap.com



Mon Jan 27, 2003 6:26 am

simonfell99
Online Now Online Now
Send Email Send Email

Forward
Message #220 of 807 |
Expand Messages Author Sort by Date

I've been working on the schema nearly nonstop for the past few days, mostly requesting help on the XSDSchema group and reading lots of documentation. Let me...
Dino Morelli <dino.mo...
dino_morelli
Offline Send Email
Jan 24, 2003
4:16 pm

I have run into a deal-stopper in constructing a schema for RSS 2.0. Meaning that there is structure in the RSS spec that can't be modeled in schema notation. ...
Dino Morelli <dino.mo...
dino_morelli
Offline Send Email
Jan 26, 2003
8:55 pm

I've seen this style of structure modeled as a repeating choice in XSD. Cheers Simon...
Simon Fell
simonfell99
Online Now Send Email
Jan 26, 2003
9:11 pm

... <choice> isn't permitted inside an <all> element, which is what allows the elements to be unordered. If the order of all elements in <channel> were forced,...
Dino Morelli <dino.mo...
dino_morelli
Offline Send Email
Jan 26, 2003
9:50 pm

... you have a sequence containing a repeating choice of all the elements, this give you what you're looking for. Cheers Simon...
Simon Fell
simonfell99
Online Now Send Email
Jan 26, 2003
9:55 pm

... In doing so, the <sequence> forces the children to be in that specific order. The RSS document I've been using as an example (yesterday's Scripting News)...
Dino Morelli <dino.mo...
dino_morelli
Offline Send Email
Jan 26, 2003
10:09 pm

... the sequence only contains the choice, the choice is set to have maxOccurs="unbounded", so that in effect you end up with any number of elements from...
Simon Fell
simonfell99
Online Now Send Email
Jan 26, 2003
10:57 pm

... Given this schema <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:element...
Simon Fell
simonfell99
Online Now Send Email
Jan 27, 2003
6:24 am

... Ok, I tried your document out and schema out and some other versions with the elements in different orders and/or missing. In your above example, it...
Dino Morelli <dino.mo...
dino_morelli
Offline Send Email
Jan 27, 2003
2:16 pm

I'm writing this to let everyone know that I'm stopping work on this and getting on to other things. To summarize, I can't figure out how to construct a schema...
Dino Morelli <dino.mo...
dino_morelli
Offline Send Email
Jan 28, 2003
2:42 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help