H
Hans-Joerg Unger
Hi !
How can I differentiate nodes in an xml-schema which have the same
name (see "file"-element in the example) , but different locations and
meanings in the xml tree:
How can i differentiate the parsing of the file-element depended to
it's parent-node ?
A example xml-fragment:
---
<test>
<hello id="FOO">
<file name="hello.txt" /> <===== file element
</hello>
<goodbye id="FOOBAR">
<file id="123123"> <===== file element
<regex name="go.txt"
match='^(.*)AAA(.*)$' value="\\1BAZ" flags="m" />
<regex name="go.txt"
match='^(.*)AAA(.*)$' value="\\1BAZAZ" flags="m" />
</file>
</goodbye>
---
A example xml-schema fragment:
---
<xsd:element name="test">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="hello" minOccurs="1" maxOccurs="unbounded"/>
<xsd:element ref="goodby" minOccurs="1" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<!-- This element points to a file-subelement -->
<xsd:element name="hello">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="file" minOccurs="1" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<!-- This element belongs to the previous element -->
<xsd:element name="file">
....
</xsd:element>
<!-- This element points to a completly different file-subelement -->
<xsd:element name="goodbye">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="file" minOccurs="1" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<!-- This element belongs to the previous element -->
<xsd:element name="file"">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="regex" minOccurs="1" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
---
How can I differentiate nodes in an xml-schema which have the same
name (see "file"-element in the example) , but different locations and
meanings in the xml tree:
How can i differentiate the parsing of the file-element depended to
it's parent-node ?
A example xml-fragment:
---
<test>
<hello id="FOO">
<file name="hello.txt" /> <===== file element
</hello>
<goodbye id="FOOBAR">
<file id="123123"> <===== file element
<regex name="go.txt"
match='^(.*)AAA(.*)$' value="\\1BAZ" flags="m" />
<regex name="go.txt"
match='^(.*)AAA(.*)$' value="\\1BAZAZ" flags="m" />
</file>
</goodbye>
---
A example xml-schema fragment:
---
<xsd:element name="test">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="hello" minOccurs="1" maxOccurs="unbounded"/>
<xsd:element ref="goodby" minOccurs="1" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<!-- This element points to a file-subelement -->
<xsd:element name="hello">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="file" minOccurs="1" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<!-- This element belongs to the previous element -->
<xsd:element name="file">
....
</xsd:element>
<!-- This element points to a completly different file-subelement -->
<xsd:element name="goodbye">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="file" minOccurs="1" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<!-- This element belongs to the previous element -->
<xsd:element name="file"">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="regex" minOccurs="1" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
---