473,405 Members | 2,338 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Self-referencing elements in XMLREAD

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
Dec 9 '05 #1
0 1281

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Marc | last post by:
Hi all, I was using Tkinter.IntVar() to store values from a large list of parts that I pulled from a list. This is the code to initialize the instances: def initVariables(self): self.e =...
15
by: Ralf W. Grosse-Kunstleve | last post by:
****************************************************************************** This posting is also available in HTML format: http://cci.lbl.gov/~rwgk/python/adopt_init_args_2005_07_02.html...
18
by: Ralf W. Grosse-Kunstleve | last post by:
My initial proposal (http://cci.lbl.gov/~rwgk/python/adopt_init_args_2005_07_02.html) didn't exactly get a warm welcome... And Now for Something Completely Different: class autoinit(object):...
4
by: David Coffin | last post by:
I'd like to subclass int to support list access, treating the integer as if it were a list of bits. Assigning bits to particular indices involves changing the value of the integer itself, but...
4
by: marek.rocki | last post by:
First of all, please don't flame me immediately. I did browse archives and didn't see any solution to my problem. Assume I want to add a method to an object at runtime. Yes, to an object, not a...
7
by: Andrew Robert | last post by:
Hi Everyone, I am having a problem with a class and hope you can help. When I try to use the class listed below, I get the statement that self is not defined. test=TriggerMessage(data) var...
24
by: Peter Maas | last post by:
The Python FAQ 1.4.5 gives 3 reasons for explicit self (condensed version): 1. Instance variables can be easily distinguished from local variables. 2. A method from a particular class can be...
84
by: braver | last post by:
Is there any trick to get rid of having to type the annoying, character-eating "self." prefix everywhere in a class? Sometimes I avoid OO just not to deal with its verbosity. In fact, I try to...
13
by: Kurda Yon | last post by:
Hi, I found one example which defines the addition of two vectors as a method of a class. It looks like that: class Vector: def __add__(self, other): data = for j in range(len(self.data)):...
6
by: Bart Kastermans | last post by:
I am playing with some trees. In one of the procedures I wrote for this I am trying to change self to a different tree. A tree here has four members (val/type/left/right). I found that self = SS...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.