Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > problem with transformiix

Reply
Thread Tools

problem with transformiix

 
 
Maik Seyring
Guest
Posts: n/a
 
      11-21-2005
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">
<xslaram name="input"/>
<xslaram 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>
<xsltherwise>
<xsl:value-of select="$input"/>
</xsltherwise>
</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
 
Reply With Quote
 
 
 
 
Magnus Henriksson
Guest
Posts: n/a
 
      11-21-2005
"Maik Seyring" <(E-Mail Removed)> wrote in message
news:4381c983$0$20839$(E-Mail Removed)-online.net...

> <xslaram 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


 
Reply With Quote
 
 
 
 
Maik Seyring
Guest
Posts: n/a
 
      11-22-2005
Magnus Henriksson wrote:

> "Maik Seyring" <(E-Mail Removed)> wrote in message
> news:4381c983$0$20839$(E-Mail Removed)-online.net...
>
>> <xslaram 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


 
Reply With Quote
 
Magnus Henriksson
Guest
Posts: n/a
 
      11-22-2005
"Maik Seyring" <(E-Mail Removed)> wrote in message
news:4382cf8c$0$20851$(E-Mail Removed)-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 <xslutput method="html"/>. This will
output empty elements as you described.

Change this to <xslutput method="xml"/>


// Magnus


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem problem problem :( Need Help Mike ASP General 2 05-11-2004 08:36 AM



Advertisments