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

Re: schema design for one element, multiple types

From: Kevin Y. Kim (Lists) <kykim_lists@mac.com>
Date: Wed, 9 Nov 2005 02:43:37 -0500
Message-Id: <226363d0960210ceb73c727949cb1b6b@mac.com>
To: xmlschema-dev@w3.org
schema multiple types

So, of course, after I read this, I realize that the complexType "foo1"
is unnecessarily complicated in the example I gave.  This is because I
need to add attributes to the "foo" element
	(i.e. <foo name="foo_name">some_value</foo>)

Thanks again,
-kevin

On Nov 8, 2005, at 11:18 PM, Kevin Y. Kim (Lists) wrote:

>
> Hi,
>
> I'm trying to define a schema that will support the following:
>
> 1    <some_xml>
> 2        <foo>some_value</foo>
> 3        <foo>
> 4            <bar>another_value</bar>
> 5        <foo>
> 6        <foo>third_value</foo>
> 7    </some_xml>
>
> Now, I know how to defined the schema for each case:
>     For 2 & 6:
>         <xsd:complexType name="foo1">
>             <xsd:simpleContent>
>                 <xsd:extension type="xsd:string"/>
>             </xsd:simpleContent>
>         </xsd:complexType>
>
> 	For 3 - 5:
>         <xsd:complexType name="foo2">
>             <xsd:sequence>
>                 <xsd:element name="bar" type="xsd:string"/>
>             </xsd:sequence>
>         </xsd:complexType>
>
> But how would I defined a schema to encompass both?
>
> Thanks,
> -kevin
>
>
>
Received on Wednesday, 9 November 2005 07:43:46 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

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-2007 All Rights Reserved.