xsl problem using charriage return

P

Patrick TJ McPhee

[I haven't seen the original question]

% <judy> wrote in message
% > 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.
 
J

judy

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>
</xsl:text>
</xsl:for-each>


</xsl:template>

</xsl:stylesheet>

My problem is the &#13 carriage return. I think this should work, but
no such luck.

I'm using Instant Saxon to parse the document.
 

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
473,999
Messages
2,570,243
Members
46,836
Latest member
login dogas

Latest Threads

Top