problem with transformiix

Discussion in 'XML' started by Maik Seyring, Nov 21, 2005.

  1. Maik Seyring

    Maik Seyring Guest

    hello to all of you

    I have got a problem with the xslt-processor transformiix used by firefox.

    The challange is to replace an special-character (within a string) with a
    <br/>-tag.

    it works fine with xsltproc but not with firefox(transformiix)

    the code is the following:

    <xsl:template name="replace-CR">
    <xsl:param name="input"/>
    <xsl:param name="search-string" select="'
    '"/> <<<This is the problem

    <xsl:variable name="temp"
    select="string-length(substring-before($input,$search-string))"/>
    <xsl:choose>

    <xsl:when test="$temp or starts-with($input,$search-string)">
    <xsl:value-of select="substring($input,1,$temp)"/>
    <br/>

    <xsl:call-template name="replace-CR">
    <xsl:with-param name="input"
    select="substring($input,$temp + string-length($search-string)+1)"/>
    <xsl:with-param name="search-string" select="$search-string"/>
    </xsl:call-template>
    </xsl:when>
    <xsl:eek:therwise>
    <xsl:value-of select="$input"/>
    </xsl:eek:therwise>
    </xsl:choose>
    </xsl:template>


    If the search-string param is an simple char or string the template works
    fine with firefox.

    Any hints?

    Thx Maik Seyring
     
    Maik Seyring, Nov 21, 2005
    #1
    1. Advertising

  2. "Maik Seyring" <> wrote in message
    news:4381c983$0$20839$-online.net...

    > <xsl:param name="search-string" select="'
    '"/> <<<This is the

    problem

    I'm surprised you got a result with xsltproc! The parser should replace all
    carriage returns (#13 or #xD) with line feeds (#10 or #xA). If you replace
    with
    you should be fine.


    // Magnus
     
    Magnus Henriksson, Nov 21, 2005
    #2
    1. Advertising

  3. Maik Seyring

    Maik Seyring Guest

    Magnus Henriksson wrote:

    > "Maik Seyring" <> wrote in message
    > news:4381c983$0$20839$-online.net...
    >
    >> <xsl:param name="search-string" select="'
    '"/> <<<This is the

    > problem
    >
    > I'm surprised you got a result with xsltproc! The parser should replace
    > all carriage returns (#13 or #xD) with line feeds (#10 or #xA). If you
    > replace
    with
    you should be fine.
    >
    >
    > // Magnus

    it seems to be true.

    The Transformiix-processor replace the carriage returns with line feeds, but
    xsltproc does not. I solved this by

    <xsl:if test="system-property('xsl:vendor')='Transformiix'">
    ....

    But there is another Question about xslt.
    My target was to replace carriage returns (line feeds) with <br/> but the
    result in the html-file is <br>.

    MAik
     
    Maik Seyring, Nov 22, 2005
    #3
  4. "Maik Seyring" <> wrote in message
    news:4382cf8c$0$20851$-online.net...

    > My target was to replace carriage returns (line feeds) with <br/> but the
    > result in the html-file is <br>.


    This depends on the output method.

    My guess is that you have specified <xsl:eek:utput method="html"/>. This will
    output empty elements as you described.

    Change this to <xsl:eek:utput method="xml"/>


    // Magnus
     
    Magnus Henriksson, Nov 22, 2005
    #4
    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. Andreas Suurkuusk
    Replies:
    0
    Views:
    3,997
    Andreas Suurkuusk
    Jul 27, 2003
  2. Ted Miller
    Replies:
    0
    Views:
    5,178
    Ted Miller
    Sep 13, 2003
  3. Merek
    Replies:
    0
    Views:
    1,979
    Merek
    Dec 3, 2003
  4. Scott Meddows
    Replies:
    1
    Views:
    404
    John Saunders
    Jun 8, 2004
  5. Mike

    Problem problem problem :( Need Help

    Mike, May 7, 2004, in forum: ASP General
    Replies:
    2
    Views:
    558
    Bullschmidt
    May 11, 2004
Loading...

Share This Page