Nested DataSet / Xsl Transformation

G

George Durzi

Check out this Xml

<NewDataSet>
<Table>
<GB_JOB_ID>8060</GB_JOB_ID>
<SALES_CODE>160</SALES_CODE>
<JOB_NUMBER>040435</JOB_NUMBER>
<JOB_NUMBER_FORMATTED>160-040435</JOB_NUMBER_FORMATTED>
<PRIMARY_COMPANY>Some Company</PRIMARY_COMPANY>
<STUDY_NAME>Name of Study</STUDY_NAME>
<ACCOUNT_MANAGER>Jane Doe</ACCOUNT_MANAGER>
</Table>
<Table1>
<CurrentWave>True</CurrentWave>
<Response>System.Data.DataSet</Response>
</Table1>
<Table1>
<CurrentWave>False</CurrentWave>
<Response>System.Data.DataSet</Response>
</Table1>
</NewDataSet>

The "Response" DataColumnof Table1 contains a small DataSet.
The above Xml was generated by doing a myDataSet.WriteXml(some file path).
I've verified that the DataSet is properly in the "Response" DataColumn; I
can iterate through it's contents in code and write them to the screen.

I'd like to perform an Xsl transformation on this Xml ... Obviously, doing a
<xsl:value-of select="Response" /> will simply give me "System.Data.DataSet"

How do I get at the DataSet that's sitting inside the "Response"
DataColumn??

For reference, here's a snippet of that that DataSet looks like, I've taken
out most of it just to keep it simple for this example

<DataConsistency>
<Company>
<CompanyId>0</CompanyId>
<CompanyName>Spike TV</CompanyName>
</Company>
<Company>
<CompanyId>1</CompanyId>
<CompanyName>Cartoon Network</CompanyName>
</Company>
<Company>
<CompanyId>2</CompanyId>
<CompanyName>Comedy Central</CompanyName>
</Company>
<Company>
<CompanyId>3</CompanyId>
<CompanyName>Discovery Channel</CompanyName>
</Company>
</DataConsistency>


I tried the following:

<xsl:for-each
select="NewDataSet/Table1/Response/DataConsistency/Company">
<td><xsl:value-of select="CompanyId" /></td>
</xsl:for-each>

I'm pretty sure that "NewDataSet/Table1/Response/DataConsistency/Company"
isn't the proper syntax ... Any tips would really help.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top