This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: adding a newline to my output with XSL


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@doubletwist.com]
Sent: Friday, October 12, 2001 8:59 PM
To: 'xsl-list@lists.mulberrytech.com'
Subject: RE: [xsl] 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]