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

D

Dmitry Kulinich

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
 
M

Martin Honnen

Dmitry said:
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.
 
D

Dmitry Kulinich

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

Shcema is needed 4 junit testing of our rendering functionality.
 
M

Martin Honnen

Dmitry said:
I must to create xsd shema for html <table> tag 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.
 
D

Dmitry Kulinich

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>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top