Loading xml into dataset fails

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

What would cause the xml in this example to fail when loaded into a dataset
Changing the childnode '<a>' under 'node2' to something else fixes the problem, but I really need to understand why this happens, although the two '<a>'s are under different nodes

<Body
- <node1><a>1</a><b>2</b></node1
- <node2
- <a><a1>1</a1><a2>2</a2></a></node2></Body>
 
There is a limit to what a dataset can infer from your xml. It roughly
assumes that an outermost element is your dataset container, and your
dataset will assume this name. The next level down is assumed to contain any
datatables. Inside that level the fields for that datatable and below that,
the actual data for those fields.

In your case I'd think it sees two a columns in both datatables and tries to
establish a relationship constraint but it cannot because the lower a
contains two more complex elements and the upper a contains just a data
item.


Justus said:
What would cause the xml in this example to fail when loaded into a dataset.
Changing the childnode '<a>' under 'node2' to something else fixes the
problem, but I really need to understand why this happens, although the two
' said:
<Body>
- <node1>
<a>1</a>
- <node2>
- <a><a1>1</a1>
<a2>2</a2>
</a>
</node2>
</Body>
 
Back
Top