binding a dataset with complex schema

K

Keith Langer

Hi,

I would like to know if it's possible to specify (via XPath or some
other mechanism) a combination of attributes and nodes to use in a
dataset. I would also like to know if I can access the local XML node
in the ItemDataBound event.

For instance, in the XML below I would want to make columns out of the
following:
1) id, adi, schedule, actual and group-code attributes of the row
tag
2) city, gate, gateremark, status, linecode, and number nodes
3) code attribute of city node and status node

To further complicate matters, I need to check each of the nodes from
#2 for an "attr" attribute. If it exists, I need to parse that value
and set some style properties for that cell.

I also need to format schedule and actual into a more friendly time
format.

From what I've seen so far, it looks like I need to flatten the schema
and either make everything an attribute of the row tag, or everything
a child node of the row tag. Child nodes with child attributes don't
seem to get recognized the same as child nodes without attributes (at
least from the "InferSchema" method. I've never written an XSD, but I
have a feeling I'm going to need one.

<rows>
<row id="285478" adi="D" group-code="400"
schedule="2003-05-15T11:42:00" actual="2003-05-15T11:42:00">
<actual attr="color:green;bold:true">2003-05-15T11:42:00</actual>
<city order="1" code="DTW" es="esDetroit,MI"
fr="frDetroit,MI">Detroit</city>
<gate>B11</gate>
<gateremark code="OT">On Time</gateremark>
<groupcodeid order="1">15</groupcodeid>
<line order="1">NORTHWEST</line>
<logo order="1"/>
<linecode order="1">NW</linecode>
<number order="1">2755</number>
<pier>14</pier>
<schedule>2003-05-15T11:42:00</schedule>
<status code="DP" es="esDeparted" fr="frDeparted">Departed</status>
<tailno>113</tailno>
</row>
<row id="285496" adi="A" group-code="811"
schedule="2003-05-15T11:45:00" actual="2003-05-15T11:45:00">
<actual>2003-05-15T11:45:00</actual>
<city order="1" code="MDW" es="esChicago-Midway"
fr="frChicago-Midway">Chicago-Midway</city>
<claim>3</claim>
<gate>C3</gate>
<gateremark code="OT">On Time</gateremark>
<groupcodeid order="1">18</groupcodeid>
<line order="1">ATA CONNX</line>
<logo order="1">inlineata.gif</logo>
<linecode order="1">TZ</linecode>
<number order="1">3228</number>
<schedule>2003-05-15T11:45:00</schedule>
<status code="AR" es="esArrived" he="????????">Arrived</status>
<tailno>112</tailno>
</row>
</rows>


thanks,
Keith
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top