xsl problem using charriage return

Discussion in 'XML' started by Wole Ogunremi, Dec 3, 2004.

  1. try
    for character 13, and
    for character 10

    <judy> wrote in message news:...
    >
    > 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.
    >
     
    Wole Ogunremi, Dec 3, 2004
    #1
    1. Advertising

  2. [I haven't seen the original question]

    % <judy> wrote in message news:...

    % > 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.

    --

    Patrick TJ McPhee
    North York Canada
     
    Patrick TJ McPhee, Dec 4, 2004
    #2
    1. Advertising

  3. Wole Ogunremi

    judy Guest

    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.
     
    judy, Dec 8, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Flood
    Replies:
    0
    Views:
    1,040
    Kevin Flood
    Sep 8, 2004
  2. Kevin Flood
    Replies:
    1
    Views:
    2,792
    Kevin Flood
    Sep 13, 2004
  3. Replies:
    1
    Views:
    3,653
    A. Bolmarcich
    May 27, 2005
  4. Replies:
    2
    Views:
    9,329
    Martin Honnen
    Sep 5, 2006
  5. Greenhorn
    Replies:
    15
    Views:
    868
    Keith Thompson
    Mar 6, 2005
Loading...

Share This Page