I've been very pleased to find that you can load an XML file into a DATASET
using the XMLREAD method, but I'm having a problem when trying to load a file
that contains self-referencing elements.
Here is an excerpt from the .XSD file ...
================================================
XSD SCHEMA DOC
================================================
<xs:element name="cursor-grove">
<xs:complexType>
<xs:sequence maxOccurs="unbounded">
<xs:element ref="cursor"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="cursor">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element ref="cursor"/>
</xs:sequence>
<xs:attribute name="id" type="id" use="required">
</xs:attribute>
<xs:attribute name="statement-id" type="id" use="required">
</xs:attribute>
<xs:attribute name="e" type="time-or-duration" use="required">
</xs:attribute>
<xs:attribute name="e-cumulative" type="time-or-duration">
</xs:attribute>
<xs:attribute name="prs" type="xs:nonNegativeInteger" use="optional">
</xs:attribute>
<xs:attribute name="elision-label" type="xs:string" use="optional">
</xs:attribute>
</xs:complexType>
</xs:element>
================================================
EXAMPLE XML
================================================
<cursor-grove e="0.156477">
<cursor e="0.09697" statement-id="7" prs="8" id="1"/>
<cursor e="0.046139" statement-id="5" prs="6" id="2">
<cursor e="0.013254" statement-id="3" prs="4" id="3"/>
</cursor>
<cursor e="0" statement-id="9" prs="10" id="4"/>
<cursor e="0.000114" statement-id="1" prs="2" id="5"/>
</cursor-grove>
================================================== ==
As you can see a cursor can contain NESTED cursors. This is valid XML but
when I try to load the XSD or the XML that conforms to this schema I get the
following message:
"The table (cursor) cannot be the child table to itself in nested relations."
What I want to happen is to get to the following relational structure:
COLUMN
============
Cursor_Id
Parent-Cursor_Id
id
statement_id
e
e-cumulative
prs
elision-label
Where Parent_Cursor_Id points to the encapsulating Cursor ID.
Is there something that Im missing, or something I need to do in terms of an
XSL transform on the XML DATA so that I don't get these problems loading the
data??
Thanks in advance.
Doug