xsl problem using charriage return

Patrick TJ McPhee

Usenet Archive
Joined
Apr 2, 2000
Messages
269
Reaction score
0
[I haven't seen the original question]

% <judy> wrote:
% > fine. Can't get the carriage return.
% >
% > Any suggestions would be helpful.
% >
% > <?xml version="1.0"?>
% > <xsl:stylesheet version="1.0"
% > xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

The problem is right here. You don't specify an output format, so your xslt processor assumes you want the default format, xml. It ends up looking like text because you don't add any elements to the result tree, but looks can be deceiving. If you add

<xsl:eek:utput method='text'/>

at this point in the style sheet, you should get the result you want.
 

Judy (archive)

Usenet Archive
Joined
Jul 19, 2001
Messages
8
Reaction score
0
I have an xml file containing a series of names, first name and last name. My desired outcome is to create an xsl file that will generate a comma delimitated text file containing these names. I need first name/ comma/ last name /carriage return. The first name comma last name work fine. Can't get the carriage return.

Any suggestions would be helpful.

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

<xsl:template match="/">

<xsl:for-each select="list/name">

<xsl:value-of select="fname"/>
<xsl:text>,</xsl:text>
<xsl:value-of select="lname"/>
<xsl:text>,</xsl:text>
<xsl:text>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,042
Messages
3,104,223
Members
248,131
Latest member
Tonypshaw1

Latest Threads

Top