Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linefeed character in output - XSL 1

Status
Not open for further replies.

2110

Programmer
Sep 17, 2001
5
US
Using XSL, I need to produce an output in the following format :
Data<Linefeed>Data<Linefeed>Data<linefeed>.....

I'm able to retrieve the data from the XML(source doc), but I don't know how to insert the linefeed character, so that my output looks like the above.

Any help would be appreciated.
Thanks

 
Tom,
My style sheet looks something like this after I included the <xsl:text>! But I don't get anything as output.!!

If I replace <xsl:text>&#10</xsl:text> with a &quot;,&quot;

This is how my output looks:
098765432,Florida.

But I dont want a &quot;'&quot; - I want a linefeed.

<xsl:stylesheet xmlns:xsl=&quot;<xsl:template match=&quot;/&quot;>
<xsl:for-each select=&quot;Body&quot;>
<xsl:value-of select=&quot;DLN&quot;/>
<xsl:text>&#10</xsl:text>
<xsl:value-of select=&quot;DLS&quot;/>
<xsl:text>&#10</xsl:text>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
 
hehe, this page keeps escaping our linefeeds - i'm getting confused!

<xsl:text>
</xsl:text>

the line feed that makes these two tags appear on different lines should be enough for the processor to pick it up.

this probably won't work either tho.

which processor do you use? i tried your code above on the gnome libxsl library and it worked - but it does seem to behave differently to other processors because the specification is SO vague on whitespace.

i did have to change the stylesheet tag tho to
<xsl:stylesheet version=&quot;1.0&quot; xmlns:xsl=&quot;
but i don't really pay much attention to the uri i use, my processor just didn't like the one u used.
 
Tom,

It worked this time. I downloaded the MSXMLv4.0 parser from the net and used it. I changed the stylesheet tag and wherever I wanted to insert the line feed tag in the output , I did this:

<xsl:text>&#10;</xsl:text>
It worked.

Thanks

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top