Last post Oct 29, 2014 03:42 AM by sw-ing
Member
18 Points
222 Posts
Oct 28, 2014 03:16 PM|samegoldinButBetter|LINK
I have the following xml that I need to transform into an attribute based hierarchy structure:
<root> <project ID="1" description="All Projects" /> <project ID="104" parentID="1" description="project 1" /> <project ID="109" parentID="104" description="project 2" /> <project ID="110" parentID="104" description="project 3" /> <project ID="111" parentID="109" description="project 4" /> <project ID="112" parentID="109" description="project 5" /> <project ID="113" parentID="109" description="project 6" />
......
Can anyone please show some xslt code?
Thanks
73 Points
43 Posts
Oct 29, 2014 01:26 AM|Rajesh Mishra|LINK
Can you please tell about the output, you want to generate?
XSLT code will be written as per the output. AN example could be :
<HTML> .... <Body> <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msxsl="urn:schemas-microsoft-com:xslt"> <table border="0" cellspacing="0" cellpadding="0"> <tr> <th>Output </th> </tr><tr><td>
<xsl:for-each select="root/project"> <xsl:value-of select="@description"/> <xsl:value-of select="@parentID"/> </xsl:for-each>
</td></tr> </table> <Body> </HTML>
590 Points
195 Posts
Oct 29, 2014 03:42 AM|sw-ing|LINK
Hi samegoldinButBetter,
As for your problem, you could refer to the following link to display XML with XSLT.
Hope it will be helpful to you.
Best Regards,
Sw-ing
Member
18 Points
222 Posts
XLST for hierarchy xml
Oct 28, 2014 03:16 PM|samegoldinButBetter|LINK
I have the following xml that I need to transform into an attribute based hierarchy structure:
<root>
<project ID="1" description="All Projects" />
<project ID="104" parentID="1" description="project 1" />
<project ID="109" parentID="104" description="project 2" />
<project ID="110" parentID="104" description="project 3" />
<project ID="111" parentID="109" description="project 4" />
<project ID="112" parentID="109" description="project 5" />
<project ID="113" parentID="109" description="project 6" />
......
Can anyone please show some xslt code?
Thanks
Member
73 Points
43 Posts
Re: XLST for hierarchy xml
Oct 29, 2014 01:26 AM|Rajesh Mishra|LINK
Can you please tell about the output, you want to generate?
XSLT code will be written as per the output. AN example could be :
Rajesh Mishra
Senior Development Engineer
Member
590 Points
195 Posts
Re: XLST for hierarchy xml
Oct 29, 2014 03:42 AM|sw-ing|LINK
Hi samegoldinButBetter,
As for your problem, you could refer to the following link to display XML with XSLT.
Hope it will be helpful to you.
Best Regards,
Sw-ing