By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,740 Members | 844 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,740 IT Pros & Developers. It's quick & easy.

(How to create)duplicate nodes with different types in XSD shema

P: n/a
Guys!
Is there are any possibility to create nodes with duplicate
names and different types in XSD? I've read the whole specification and
tried in a many different ways, but not successfull.
--
Thank you for any help,
Dmitry Kulinich,
Ukrain,
ISD company,
EPE
Feb 19 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Dmitry Kulinich wrote:
Is there are any possibility to create nodes with duplicate
names and different types in XSD? I've read the whole specification and
tried in a many different ways, but not successfull.
It is a question of scope, you can have e.g.

<xs:element name="root">
<xs:complexType>
<xs:sequence maxOccurs="unbounded">
<xs:element name="element1">
<xs:complexType>
<xs:sequence>
<xs:element name="example" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="element2">
<xs:complexType>
<xs:sequence>
<xs:element name="example" type="xs:double"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>

with an instance document of e.g.

<root>
<element1>
<example>Kibo</example>
</element1>
<element2>
<example>3.1415927</example>
</element2>
</root>

without problems.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Feb 19 '07 #2

P: n/a
Thanks Martin.
Problem doesn't belong to scope.
I must to create xsd shema for html <tabletag with
a lot <tr>s and <td>s that contains different nodes.

Shcema is needed 4 junit testing of our rendering functionality.

"Martin Honnen" <ma*******@yahoo.dewrote in message
news:45***********************@newsspool4.arcor-online.net...
Dmitry Kulinich wrote:
>Is there are any possibility to create nodes with duplicate
names and different types in XSD? I've read the whole specification and
tried in a many different ways, but not successfull.

It is a question of scope, you can have e.g.

<xs:element name="root">
<xs:complexType>
<xs:sequence maxOccurs="unbounded">
<xs:element name="element1">
<xs:complexType>
<xs:sequence>
<xs:element name="example" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="element2">
<xs:complexType>
<xs:sequence>
<xs:element name="example" type="xs:double"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>

with an instance document of e.g.

<root>
<element1>
<example>Kibo</example>
</element1>
<element2>
<example>3.1415927</example>
</element2>
</root>

without problems.

--

Martin Honnen
http://JavaScript.FAQTs.com/

Feb 19 '07 #3

P: n/a
Dmitry Kulinich wrote:
I must to create xsd shema for html <tabletag with
a lot <tr>s and <td>s that contains different nodes.
If you provide some sample then perhaps someone is able to help develop
a schema for it or give a definitive answer that it is not possible.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Feb 19 '07 #4

P: n/a
ok he is my fragment - it is exactly what I need but it doesn't work. I've
plaid a little bit with dinamic type definition (throught different types in
enumeration . but it also does'n work)
We have a few nodes with similar names and different types - that the
point:
<xsd:element name="TABLE">

<xsd:complexType>

<xsd:sequence>

<xsd:element ref="TBODY"/>

</xsd:sequence>

</xsd:complexType>

</xsd:element>
<xsd:element name="TBODY">

<xsd:complexType>

<xsd:element ref="TR" type="headerTR"/>

<xsd:element ref="TR" type="dataLinesTR"/>

</xsd:complexType>

</xsd:element>

<xsd:complexType name="headerTR">

<xsd:sequence>

<xsd:element name="TH" type="xsd:string" fixed="Process ID"/>

<xsd:element name="TH" type="xsd:string" fixed="Activity ID"/>

<xsd:element name="TH" type="xsd:string" fixed="Instance ID"/>

<xsd:element name="TH" type="xsd:string" fixed="Process Description"/>

</xsd:sequence>

</xsd:complexType>

<xsd:complexType name="dataLinesTR">

<xsd:sequence>

<xsd:element name="TD" >

<xsd:complexType>

<xsd:sequence>

<xsd:element name="SCRIPT">

<xsd:complexType>

<xsd:attribute name="LANGUAGE" type="xsd:string" fixed="JavaScript"
use="required"/>

<xsd:attribute name="SRC" type="xsd:string"
fixed="components/js/component.js" use="required"/>

</xsd:complexType>

</xsd:element>

<xsd:element name="A" fixed="TEST_QUEUE_LIST">

<xsd:complexType>

<xsd:simpleContent>

<xsd:extension base="xsd:string">

<xsd:attribute name="ID" type="xsd:string" use="required"/>

<xsd:attribute name="NAME" type="xsd:string"
fixed="control12082_TEST_QUEUE_LIST_hidden" use="required"/>

<xsd:attribute name="HREF" type="xsd:string" fixed="test_href"
use="required"/>

<xsd:attribute name="TABINDEX" type="xsd:integer" fixed="1" use="required"/>

</xsd:extension>

</xsd:simpleContent>

</xsd:complexType>

</xsd:element>

</xsd:sequence>

</xsd:complexType>

</xsd:element>

<xsd:element name="TD" type="xsd:string" fixed="ACT8744"/>

<xsd:element name="TD" type="xsd:string" fixed="0000021376"/>

<xsd:element name="TD" type="xsd:string" fixed="TEST_QUEUE_LIST 2006-12-28
14:32:06.12"/>

</xsd:sequence>

</xsd:complexType>
"Martin Honnen" <ma*******@yahoo.dewrote in message
news:45***********************@newsspool1.arcor-online.net...
Dmitry Kulinich wrote:
>I must to create xsd shema for html <tabletag with
a lot <tr>s and <td>s that contains different nodes.

If you provide some sample then perhaps someone is able to help develop a
schema for it or give a definitive answer that it is not possible.
--

Martin Honnen
http://JavaScript.FAQTs.com/

Feb 19 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.