[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

line feeds when outputing as text

Subject: line feeds when outputing as text
From: Sam Carleton <sam@xxxxxxxxxxxxxx>
Date: Mon, 3 Mar 2003 15:13:31 -0500
line feeds
Folks,

I have an xml file that contains item elements.  Some items have an
url attribute.  I am trying to write a xslt program to give me each
url on a separate line.  I figured this would work:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:output method="text" indent="yes"/>

  <xsl:template match="/">
    <xsl:apply-templates select=".//item[string-length(@url)!=0]"/>
  </xsl:template>

  <xsl:template match="item">
    <xsl:value-of select="@url"/>
  </xsl:template>

</xsl:stylesheet>

The problem with this is that there is no line breaking between the
different URL's.  I tried adding both a &#13; and &#10; (forgetting
which one UNIX likes):

  <xsl:template match="item">
    <xsl:value-of select="@url"/>&#13;
  </xsl:template>

And that still had no effect.  Finally I tried to tack something on
the front and that DID work:

  <xsl:template match="item">
    :<xsl:value-of select="@url"/>
  </xsl:template>

I could live with this except for the fact that there is no line on
the last entry so my shell script is not picking up the last entry.
How do I get a linefeed at the end?

Sam

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.