Loading XML for dummies...
Hi - intrigued by this datagrid thing, looks like it could be very useful to us as a reporting tool. Nice work. Anyway - onto my question:
I'm trying to load XML that's structured roughly thus:
<dataroot>
<ProductData>
<ProductSet pName="Dave">
<sku_id>1543</sku_id>
<product_id>CVLC13</product_id>
<description>Ibble</description>
<country>Obble</country>
<region>Bob</region>
</ProductSet>
<ProductCopy>
..some stuff..
</ProductCopy>
<ProductPictures>
..some stuff..
</ProductPictures>
</ProductData>
</dataRoot>
I would like the grid to create a row for each ProductData node, and columns based on the 5 nodes under each ProductSet node.
My code, thus far, looks like this: (don't laugh..)
<html>
<head>
<link href="runtime/classic/activeui.css" rel="stylesheet" type="text/css" />
<script src="runtime/activeui.js"></script>
</head>
<body>
<script>
var xPaths=new Array("/dataroot/productData/productSet/sku_id","/dataroot/productData/productSet/product_id","/dataroot/productData/productSet/description","/dataroot/productData/productSet/country","/dataroot/productData/productSet/region")
var table = new Active.XML.Table;
table.setURL("data/kevinTheXMLfile.xml");
table.setColumns(xPaths);
table.request();
var obj = new Active.Controls.Grid;
obj.setProperty("column/count", 5);
obj.setModel("data", table);
document.write(obj);
</script>
</body>
</html>
And, unsurprisingly, I'm not getting the results I'm expecting. What I AM getting, is a page that loads without any apparent errors containg a datagrid with four columns named "Column 1", "Column 2" etc, and about 130-140 rows. Rows 1-99 are numbered, after that the rows have no label. Every cell contains the value "null".
Any and all help much appreciated.
I'm trying to load XML that's structured roughly thus:
<dataroot>
<ProductData>
<ProductSet pName="Dave">
<sku_id>1543</sku_id>
<product_id>CVLC13</product_id>
<description>Ibble</description>
<country>Obble</country>
<region>Bob</region>
</ProductSet>
<ProductCopy>
..some stuff..
</ProductCopy>
<ProductPictures>
..some stuff..
</ProductPictures>
</ProductData>
</dataRoot>
I would like the grid to create a row for each ProductData node, and columns based on the 5 nodes under each ProductSet node.
My code, thus far, looks like this: (don't laugh..)
<html>
<head>
<link href="runtime/classic/activeui.css" rel="stylesheet" type="text/css" />
<script src="runtime/activeui.js"></script>
</head>
<body>
<script>
var xPaths=new Array("/dataroot/productData/productSet/sku_id","/dataroot/productData/productSet/product_id","/dataroot/productData/productSet/description","/dataroot/productData/productSet/country","/dataroot/productData/productSet/region")
var table = new Active.XML.Table;
table.setURL("data/kevinTheXMLfile.xml");
table.setColumns(xPaths);
table.request();
var obj = new Active.Controls.Grid;
obj.setProperty("column/count", 5);
obj.setModel("data", table);
document.write(obj);
</script>
</body>
</html>
And, unsurprisingly, I'm not getting the results I'm expecting. What I AM getting, is a page that loads without any apparent errors containg a datagrid with four columns named "Column 1", "Column 2" etc, and about 130-140 rows. Rows 1-99 are numbered, after that the rows have no label. Every cell contains the value "null".
Any and all help much appreciated.
Wintermute
February 26,