G
Guest
Hi,
I have a "flat" XML file that I want to convert to a hierarchy as listed on
the bottom.
The XSLT I tried works fine in the XSelerator too but is slow when using
XslTransform().
Is there a way to do this using a DataSet or DataView? I've looked into
DataRelations but that works with 2 or more datatables. I only have the one
below
FROM...
<NewDataSet>
<row>
<CompanyId>676708</CompanyId>
<CompanyName>Acme Corporation</CompanyName>
<CodeId>20</CodeId>
<CodeName>AAAA</CodeName>
</row>
<row>
<CompanyId>676708</CompanyId>
<CompanyName>Acme Corporation</CompanyName>
<CodeId>21</CodeId>
<CodeName>BBBB</CodeName>
</row>
<row>
<CompanyId>676708</CompanyId>
<CompanyName>Acme Corporation</CompanyName>
<CodeId>22</CodeId>
<CodeName>CCCCCC</CodeName>
</row>
<row>
<CompanyId>676708</CompanyId>
<CompanyName>Acme Corporation</CompanyName>
<CodeId>23</CodeId>
<CodeName>DDDDD</CodeName>
</row>
</NewDataSet
TO...
<?xml version="1.0" encoding="UTF-16"?>
<companycodelist>
<company>
<companyid>676708</companyid>
<companyname>Acme Corporation</companyname>
<codes>
<code id="20" name="AAAA"></code>
<code id="21" name="BBBB"></code>
<code id="22" name="CCCCCC"></code>
<code id="23" name="DDDDD"></code>
</codes>
</company>
</companycodelist>
I have a "flat" XML file that I want to convert to a hierarchy as listed on
the bottom.
The XSLT I tried works fine in the XSelerator too but is slow when using
XslTransform().
Is there a way to do this using a DataSet or DataView? I've looked into
DataRelations but that works with 2 or more datatables. I only have the one
below
FROM...
<NewDataSet>
<row>
<CompanyId>676708</CompanyId>
<CompanyName>Acme Corporation</CompanyName>
<CodeId>20</CodeId>
<CodeName>AAAA</CodeName>
</row>
<row>
<CompanyId>676708</CompanyId>
<CompanyName>Acme Corporation</CompanyName>
<CodeId>21</CodeId>
<CodeName>BBBB</CodeName>
</row>
<row>
<CompanyId>676708</CompanyId>
<CompanyName>Acme Corporation</CompanyName>
<CodeId>22</CodeId>
<CodeName>CCCCCC</CodeName>
</row>
<row>
<CompanyId>676708</CompanyId>
<CompanyName>Acme Corporation</CompanyName>
<CodeId>23</CodeId>
<CodeName>DDDDD</CodeName>
</row>
</NewDataSet
TO...
<?xml version="1.0" encoding="UTF-16"?>
<companycodelist>
<company>
<companyid>676708</companyid>
<companyname>Acme Corporation</companyname>
<codes>
<code id="20" name="AAAA"></code>
<code id="21" name="BBBB"></code>
<code id="22" name="CCCCCC"></code>
<code id="23" name="DDDDD"></code>
</codes>
</company>
</companycodelist>