Hi
| am a newbie with XML but from a Asp.net background. I need to convert an XML file to different format.
The file that needs to be converted looks like this
<products>
<product>
<program_id><![CDATA[106]]></program_id>
<program_name><![CDATA[Widets Inc]]></program_name>
<product_id><![CDATA[106OFB]]></product_id>
<product_name><![CDATA[Large Widget]]</product_name>
<description><![CDATA[Large Widget with brown wotsits.]]></description>
<price><![CDATA[99.95]]></price>
<last_updated><![CDATA[2006-04-11 10:12:23]]></last_updated>
</program_id>
</product>
</products>
and I need it to be converted into an XML file below
<products>
<product>
<ProductID><![CDATA[5613]]></ProductID>
<ProductName><![CDATA[Widget 1]]></ProductName>
<ProductPrice><![CDATA[9.99]]></ProductPrice>
<ProductDescription><![CDATA[A Black widget with lots of wotsits attached?]]></ProductDescription>
<ProductUpdatedDate><![CDATA[04-04-2005 12:40]]></ProductUpdatedDate>
</product>
</product>
As can be seen I dont need all the fields(elements?)(ie. program name) but I do need the field names changing to the correct case and description. I think I need to produce an XSLT sheet but after sweating for the last two days without much success. All I seem to get is one long product node with attributes without CDATA Can anyone suggest what the XSLT file should look like?
| am a newbie with XML but from a Asp.net background. I need to convert an XML file to different format.
The file that needs to be converted looks like this
<products>
<product>
<program_id><![CDATA[106]]></program_id>
<program_name><![CDATA[Widets Inc]]></program_name>
<product_id><![CDATA[106OFB]]></product_id>
<product_name><![CDATA[Large Widget]]</product_name>
<description><![CDATA[Large Widget with brown wotsits.]]></description>
<price><![CDATA[99.95]]></price>
<last_updated><![CDATA[2006-04-11 10:12:23]]></last_updated>
</program_id>
</product>
</products>
and I need it to be converted into an XML file below
<products>
<product>
<ProductID><![CDATA[5613]]></ProductID>
<ProductName><![CDATA[Widget 1]]></ProductName>
<ProductPrice><![CDATA[9.99]]></ProductPrice>
<ProductDescription><![CDATA[A Black widget with lots of wotsits attached?]]></ProductDescription>
<ProductUpdatedDate><![CDATA[04-04-2005 12:40]]></ProductUpdatedDate>
</product>
</product>
As can be seen I dont need all the fields(elements?)(ie. program name) but I do need the field names changing to the correct case and description. I think I need to produce an XSLT sheet but after sweating for the last two days without much success. All I seem to get is one long product node with attributes without CDATA Can anyone suggest what the XSLT file should look like?