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

RE: adding a newline to my output with XSL

Subject: RE: adding a newline to my output with XSL
From: Pankaj Jain <pjain@xxxxxxxxxxx>
Date: Mon, 15 Oct 2001 14:22:44 +0100
xsl output newline
Archie,
Sorry for not being coherent.  What I was trying to do was put one record on
each line separated by commas.  I figured it out how to get what I needed
below.

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
  <xsl:output method="text" omit-xml-declaration="yes" indent="no" />
    <xsl:strip-space elements="/Equities/Equity" />
      <xsl:template match="/">
    <xsl:apply-templates />
    </xsl:template>
    
    <xsl:template match="Equity/*">
      <xsl:value-of select="text()" /><xsl:text>,</xsl:text>
      </xsl:template>
</xsl:stylesheet>




-----Original Message-----
From: Archie Russell [mailto:archier@xxxxxxxxxxxxxxx]
Sent: Friday, October 12, 2001 8:59 PM
To: 'xsl-list@xxxxxxxxxxxxxxxxxxxxxx'
Subject: RE:  adding a newline to my output with XSL



not sure exactly what you're trying to do--do you want them all on a single
line, or one on each line?

if you want a newline in there, just  put a newline in <xsl:text> at the end
of your equity template....eg

<xsl:text>
</xsl:text>

-a

> I am trying to take an XML and create a pipe delimited file, or comma
> delimited file.  My problem so far is that using the 
> stylesheet below, all
> newlines are eliminated, however, if I take out the '<xsl:strip-space
> elements="*">' statement, then I get one value on each line.  
> What I would
> like to do is put each "<Equity>" entry on a line with a '|' 
> or a ',' as the
> delimiter.
> 

> 
> 
> <?xml version="1.0"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
> 	<xsl:output method="text" omit-xml-declaration="yes" 
> indent="no" />
> 	<xsl:strip-space elements="*">
> 	<xsl:template match="/Equities" mode="listdetails">
>    		<xsl:apply-templates />
>     </xsl:template>
> 
> 	<xsl:template match="/Equity" mode="listdetails">
> 		<xsl:value-of select="name()" />
> 		<xsl:value-of select="text()" /> 
> 		<xsl:text disable-output-escaping="yes"></xsl:text>
> 	</xsl:template>
> 
> </xsl:stylesheet>
> 
> 
> 
> ----------------------------------------------------
> This email with all information contained herein or attached 
> hereto may
> contain confidential and/or privileged information intended for the
> addressee(s) only.  If you have received this email in error, 
> please contact
> the sender and immediately delete this email in its entirety and any
> attachments thereto..
> 
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 

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


----------------------------------------------------
This email with all information contained herein or attached hereto may
contain confidential and/or privileged information intended for the
addressee(s) only.  If you have received this email in error, please contact
the sender and immediately delete this email in its entirety and any
attachments thereto..



 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.