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

Re: OT: Schema Q

Subject: Re: OT: Schema Q
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Fri, 21 Feb 2003 18:45:49 +0000
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


Current Thread

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
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.