problem with transformiix

M

Maik Seyring

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
 
M

Magnus Henriksson

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

Maik Seyring

Magnus said:
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
 
M

Magnus Henriksson

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
 

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

Similar Threads

Nested call-templates 1
Inlining or de-xmlifying xml using XSLT 8
XSL node as string 1
apply template with variable 3
newbie xsl / xslt question 2
Replace String 6
URL string manipulation 1
Applying templates 3

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top