I
infiniti
Hi,
I am coming across problems in trying to EFFICIENTLY merge to XML
files into one which involves transposing the rows into columns so that
I can either generate a single flat xml file or store it in a flat
table in the database.
The 2 XML files which I have are:
<xml>
<keyword>
<name>abc</name>
<count>143</count>
</keyword>
<keyword>
<name>def</name>
<count>757</count>
</keyword>
<keyword>
<name>ghi</name>
<count>221</count>
</keyword>
</xml>
<xml>
<response searchTerm="abc">
<listing rank="1" bid="0.5"/>
<listing rank="2" bid="6.5"/>
<listing rank="3" bid="4.5"/>
</response>
<response searchTerm="def">
<listing rank="1" bid="4.5"/>
<listing rank="2" bid="34.5"/>
<listing rank="3" bid="1.5"/>
</response>
<response searchTerm="ghi">
<listing rank="1" bid="33.5"/>
<listing rank="2" bid="1.5"/>
<listing rank="3" bid="6.5"/>
</response>
</xml>
I want to merge the 2 xml files into one XML file and later want to
store it into a flat database table.
The structure of the output xml file is:
<xml>
<row keyword="abc" count="143" bid1="0.5" bid2="6.5"
bid3="4.5"/>
<row keyword="def" count="757" bid1="4.5" bid2="34.5"
bid3="1.5"/>
<row keyword="ghi" count="221" bid1="33.5" bid2="1.5"
bid3="6.5"/>
</xml>
Similariy the database table columns will be:
autoid, keyword, count, bid1, bid2, bid3
I am able to achieve this join by parsing the xml file, but I want to
do it as efficiently as possible (I guess using XSLT) as I have to do
this for 10,000+ thousand keywords.
Any help is greatly appreciated.
Thanks,
Amber
I am coming across problems in trying to EFFICIENTLY merge to XML
files into one which involves transposing the rows into columns so that
I can either generate a single flat xml file or store it in a flat
table in the database.
The 2 XML files which I have are:
<xml>
<keyword>
<name>abc</name>
<count>143</count>
</keyword>
<keyword>
<name>def</name>
<count>757</count>
</keyword>
<keyword>
<name>ghi</name>
<count>221</count>
</keyword>
</xml>
<xml>
<response searchTerm="abc">
<listing rank="1" bid="0.5"/>
<listing rank="2" bid="6.5"/>
<listing rank="3" bid="4.5"/>
</response>
<response searchTerm="def">
<listing rank="1" bid="4.5"/>
<listing rank="2" bid="34.5"/>
<listing rank="3" bid="1.5"/>
</response>
<response searchTerm="ghi">
<listing rank="1" bid="33.5"/>
<listing rank="2" bid="1.5"/>
<listing rank="3" bid="6.5"/>
</response>
</xml>
I want to merge the 2 xml files into one XML file and later want to
store it into a flat database table.
The structure of the output xml file is:
<xml>
<row keyword="abc" count="143" bid1="0.5" bid2="6.5"
bid3="4.5"/>
<row keyword="def" count="757" bid1="4.5" bid2="34.5"
bid3="1.5"/>
<row keyword="ghi" count="221" bid1="33.5" bid2="1.5"
bid3="6.5"/>
</xml>
Similariy the database table columns will be:
autoid, keyword, count, bid1, bid2, bid3
I am able to achieve this join by parsing the xml file, but I want to
do it as efficiently as possible (I guess using XSLT) as I have to do
this for 10,000+ thousand keywords.
Any help is greatly appreciated.
Thanks,
Amber