|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: OT: Schema Q
Hi Sam,
> I am having problems with a XML Schema. I hope that this is not too
> far off topic. If it is, and someone knows of a mailing-list that is
> dedicated to XML Schema, please enlighten me.
Try xmlschema-dev@xxxxxxx See http://www.w3.org/Mail for details about
subscribing.
> My Q:
>
> There once was an element named text:
>
> <text></text>
>
> It always like to hold onto some text:
>
> <text>I am inside!</text>
>
> But sometime it likes to have another element, bob, appear zero or
> more times inside itself:
>
> <text>this is<bob/>all inside<bob/>the element named<bob/>
> text</text>
>
> The question is how is the element text defined in a schema?
Since it can hold elements, it must be an element of a complex type:
<xs:element name="text">
<xs:complexType>
...
</xs:complexType>
</xs:element>
Since it can also hold text, it must be a complex type with mixed
content:
<xs:element name="text">
<xs:complexType mixed="true">
...
</xs:complexType>
</xs:element>
Then the content model is just the same as it would be if <text>
*only* held the <bob> elements:
<xs:element name="text">
<xs:complexType mixed="true">
<xs:sequence>
<xs:element ref="bob" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
</xs:element>
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








