newline in xml out put
Posted: Fri Sep 18, 2009 10:32 pm
Hi,
I am trying to out put the contents of xml file in the form of html table. Data within xml tags displayed as individual rows data.
for example:
<Cd>
<songs>
1. BillieJean
2. Read my heart
3. No where to go
</songs>
<songs>
1. Bad
2. I am sorry
3. Jump on train
</songs>
</Cd>
My xslt outputs the data in the form of html table with
<xsl:for-each select="Cd/songs">
<xsl:value-of select="."/>
</xsl:for-each>
My problem is the output comes as a single line in these rows
(1. BillieJean2. Read my heart3. No where to go). I want these be displayed as individual lines withis the each row of table.
(
1. Bad
2. I am sorry
3. Jump on train
) Just like what I see in xml file.
I tried all sorts <xsl:text>
</xsl:text> and newline characters but I am unable to produce the desired results.
Can any one please suggest what changes I need to do to get the desired results?
Thank you in advance.
I am trying to out put the contents of xml file in the form of html table. Data within xml tags displayed as individual rows data.
for example:
<Cd>
<songs>
1. BillieJean
2. Read my heart
3. No where to go
</songs>
<songs>
1. Bad
2. I am sorry
3. Jump on train
</songs>
</Cd>
My xslt outputs the data in the form of html table with
<xsl:for-each select="Cd/songs">
<xsl:value-of select="."/>
</xsl:for-each>
My problem is the output comes as a single line in these rows
(1. BillieJean2. Read my heart3. No where to go). I want these be displayed as individual lines withis the each row of table.
(
1. Bad
2. I am sorry
3. Jump on train
) Just like what I see in xml file.
I tried all sorts <xsl:text>
</xsl:text> and newline characters but I am unable to produce the desired results.
Can any one please suggest what changes I need to do to get the desired results?
Thank you in advance.