[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: New Line using XSLT
Hi, when outputting text with new line(s) I favor using a value-of element plus seperator with any number of nested sequence elements. For 'new line' as seperator I prefer using codepoints-to-string(10), which worked for me as the most reliable way. I bet there are pros and cons, but at the moment this works best for me and seems to be the most flexible. Sample: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:output method="text"/> <xsl:template match="/"> <xsl:value-of separator="{codepoints-to-string(10)}"> <xsl:for-each select="1 to 10"> <xsl:sequence select="."/> </xsl:for-each> </xsl:value-of> </xsl:template> </xsl:stylesheet> One con would be that this reqires XSLT 2.0/XPath 2.0. Heiko > Hi, > > I want to generate a "text" file in which every row should be in separate > line. > I have use "
,
" and <xsl:text> > </xsl:text> > > But all the above seems not to work. > > Please suggest. > > -- > Vishnu Singh | http://marklogicgd.blogspot.in/
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|