You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by John Ollier <jo...@capula.co.uk> on 2002/11/19 12:54:55 UTC

can't disable output escaping

Hello all

I want to get this into my output document:

<a  onMouseOver=" simpleMouseOver( ' id_a ' ) " >

I thought I could do it like this:

<a>
<xsl:attribute name="href">#</xsl:attribute>
<xsl:attribute name="onMouseOver"> simpleMouseOver 
<xsl:text disable-output-escaping="yes">( ' </xsl:text>
<xsl:apply-templates mode="getDivId" select="info" /> 
<xsl:text disable-output-escaping="yes"> ') </xsl:text>
</xsl:attribute>
.....

But what I get is:

<a href="#" onMouseOver="simpleMouseOver ( &apos; id_a &apos; ) 
......

Any idea what I'm doing wrong? 

Thanks in advance.

John



RE: can't disable output escaping

Posted by Antony Quinn <an...@caret.cam.ac.uk>.
John,

Try this:

<xsl:variable name="id"><xsl:apply-templates mode="getDivId" select="info"
/></xsl:variable>
<a href="#" onMouseOver="simpleMouseOver('{$id}')">

If you get unwanted space in the id variable you can change the second line
to:

<a href="#" onMouseOver="simpleMouseOver('{normalize-space($id)}')">

Regards,

Antony

-----Original Message-----
From: John Ollier [mailto:john.ollier@capula.co.uk]
Sent: 19 November 2002 11:55
To: xalan-j-users@xml.apache.org
Subject: can't disable output escaping


Hello all

I want to get this into my output document:

<a  onMouseOver=" simpleMouseOver( ' id_a ' ) " >

I thought I could do it like this:

<a>
<xsl:attribute name="href">#</xsl:attribute>
<xsl:attribute name="onMouseOver"> simpleMouseOver
<xsl:text disable-output-escaping="yes">( ' </xsl:text>
<xsl:apply-templates mode="getDivId" select="info" />
<xsl:text disable-output-escaping="yes"> ') </xsl:text>
</xsl:attribute>
.....

But what I get is:

<a href="#" onMouseOver="simpleMouseOver ( &apos; id_a &apos; )
......

Any idea what I'm doing wrong?

Thanks in advance.

John