3.2.0

XML problem - anyone got ideas?

Ok,

I like that AW support XML for datasets. But, here is my problem:

And, since I'm gonna screw up the terminology, bear with me:

I might have a data set like:
<company>
<name>456</name>
<phone>456</phone>
</company>
<company>
<name>123</name>
<address>123</address>
<city>123</city>
<phone>123</phone>
</company>

Which, is valid in an XML file. Now, if I read this into an AW grid and display as columns "Name", "Address", "City", "Phone" ... I'd think it would be able to display the records correctly (2 rows). But, it doesn't. It actually screws up the columns/rowdata.

I don't have control over the XML dataset. All I can do is read it in from the server.

Does anyone know how to get AW to account for missing data, assign the values correctly (possible based on TAG) and negate this issue?

AW is a good tool ... but I think, unless I'm missing something - if I am, please yell, the XML support does need a little work.
Carl
May 2,
Carl,

that should be possible - look at /examples/old/xml-data island-xpath.htm

You just have to specify XPath expression for each of the columns using setColumns(arrayOfXPath) call, for example,

table.setColumns(["name", "address", "city", "phone"]);

By default the cell XPath is "*", so when some nodes are missing the cells get shifted values, but when you specify exact XPath for each cell - the values will be taken from the correct place.
Alex (ActiveWidgets)
May 2,
Ahhh ... I understand. Thanks Alex. I just wasn't grasping it in previous conversations we had. I'll implement it today.

Carl
May 3,

This topic is archived.

See also:


Back to support forum