Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old March 8th, 2006, 06:15 PM
Amol
Guest
 
Posts: n/a
Default Question about xsd:extension

Hi all,
I have a case where I have a element that can appear under multiple
elements
e.g.
<AppFunctions>
<UseTemplate name="1"/>
<MethodSet name="2">
<UseTemplate name="3" />
<MethodCall name="4" />
</MethodSet>
<MethodSet name="5">
<MethodCall name="6" />
</MethodSet>
<UseTemplate name="7" />
</AppFunctions>

I would like a way to define a root element which has just the
UseTemplate element and then derive 2 elements from it "AppFunctions"
and "MethodSet" which extend it to add further elements to it. This
elements in the derived elements need to unordered and can occur
multiple times. This is what I came up with:

<xs:complexType name="UIElementType">
<xs:choice maxOccurs="unbounded">
<xs:element name="UseTemplate" type="UseTemplateType"
minOccurs="0"
maxOccurs="unbounded" />
</xs:choice>
</xs:complexType>

<xs:complexType name="AppFunctionType">
<xs:complexContent>
<xs:extension base="UIElementType">
<xs:choice maxOccurs="unbounded">
<xs:element name="MethodSet"
type="MethodSetType"
maxOccurs="unbounded" />
</xs:choice>
</xs:extension>
</xs:complexContent>
</xs:complexType>

<xs:complexType name="MethodSetType">
<xs:complexContent>
<xs:extension base="UIElementType">
<xs:choice maxOccurs="unbounded">
<xs:element name="MethodCall"
type="MethodCallType" minOccurs="0"
maxOccurs="unbounded" />
</xs:choice>
<xs:attribute name="name" type="xs:string"
use="required" />
</xs:extension>
</xs:complexContent>
</xs:complexType>

This definition is allowing me mutiple UseTemplate nodes directly under
AppFunctions but once I add a MethodSet node under AppFunctions, it
does not allow any UseTemplates anymore.

Thanx in advance,
Amol.

 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles