Hi,
I'm wondering if anybody could help me with the following?
I have this XML:
[code=xml]
<?xml version="1.0" encoding="utf-8"?>
<dataset xmlns="http://developer.cogno s.com/schemas/xmldata/1/" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance">
<!--
<dataset
xmlns="http://developer.cogno s.com/schemas/xmldata/1/"
xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
xs:schemaLocati on="http://developer.cogno s.com/schemas/xmldata/1/ xmldata.xsd"
>
-->
<metadata>
<item name="Product type" type="xs:string " length="102"/>
<item name="Quantity" type="xs:int" precision="1"/>
</metadata>
<data>
<row>
<value>Binocula rs</value>
<value>107508 7</value>
</row>
<row>
<value>Climbi ng Accessories</value>
<value>585025 1</value>
</row>
<row>
<value>Cookin g Gear</value>
<value>13400351 </value>
</row>
</data>
</dataset>
[/code]
which I want to transform to the following using XSL (the number of row nodes is not fixed):
[code=xml]
<?xml version="1.0" encoding="utf-8"?>
<data>
<row
ProductType="Bi noculars"
Quantity="10750 87"
/>
<row
ProductType="Cl imbing Accessories"
Quantity="58502 51"
/>
<row
ProductType="Co oking Gear"
Quantity="13400 351"
/>
</data>
[/code]
Please notice that the metadata node (in the source XML) contains the names to be used in the resulting XML file as attribute names and that the name can contain one or more spaces (as indicated below).
<metadata>
<item name="Product type" type="xs:string " length="102"/>
<item name="Quantity" type="xs:int" precision="1"/>
</metadata>
Thank you very much in advance...
I'm wondering if anybody could help me with the following?
I have this XML:
[code=xml]
<?xml version="1.0" encoding="utf-8"?>
<dataset xmlns="http://developer.cogno s.com/schemas/xmldata/1/" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance">
<!--
<dataset
xmlns="http://developer.cogno s.com/schemas/xmldata/1/"
xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
xs:schemaLocati on="http://developer.cogno s.com/schemas/xmldata/1/ xmldata.xsd"
>
-->
<metadata>
<item name="Product type" type="xs:string " length="102"/>
<item name="Quantity" type="xs:int" precision="1"/>
</metadata>
<data>
<row>
<value>Binocula rs</value>
<value>107508 7</value>
</row>
<row>
<value>Climbi ng Accessories</value>
<value>585025 1</value>
</row>
<row>
<value>Cookin g Gear</value>
<value>13400351 </value>
</row>
</data>
</dataset>
[/code]
which I want to transform to the following using XSL (the number of row nodes is not fixed):
[code=xml]
<?xml version="1.0" encoding="utf-8"?>
<data>
<row
ProductType="Bi noculars"
Quantity="10750 87"
/>
<row
ProductType="Cl imbing Accessories"
Quantity="58502 51"
/>
<row
ProductType="Co oking Gear"
Quantity="13400 351"
/>
</data>
[/code]
Please notice that the metadata node (in the source XML) contains the names to be used in the resulting XML file as attribute names and that the name can contain one or more spaces (as indicated below).
<metadata>
<item name="Product type" type="xs:string " length="102"/>
<item name="Quantity" type="xs:int" precision="1"/>
</metadata>
Thank you very much in advance...
Comment