Re: [xsl] SSI echo as an attribute value

Subject: Re: [xsl] SSI echo as an attribute value
From: "tom tom" <tomxsllist@xxxxxxxxxxx>
Date: Thu, 14 Sep 2006 16:00:20 +0100
I lied - it doesn't work either way when the attribute is href. It seems to be fine when the attribute is not href doing it either way. I am using saxon 8. Here is my full stylesheet:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY  start-comment "&#xE501;">
<!ENTITY  end-comment "&#xE502;">
]>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="2.0">
<xsl:output method="html" encoding="utf-8" indent="no"
use-character-maps="comment-delimiters"/>
<xsl:character-map name="comment-delimiters">
<xsl:output-character character="&start-comment;" string="&lt;!--"/>
<xsl:output-character character="&end-comment;" string="--&gt;"/>
</xsl:character-map>
<xsl:template match="/">
<a href="&start-comment;ddd&end-comment;" hreuf="&start-comment;ddd&end-comment;">
&start-comment;dffffdd&end-comment; </a>
</xsl:template>
</xsl:stylesheet>


The hreuf attribute comes out as intended, the href attribute comes out as %EE%94%81ddd%EE%94%82.

Any ideas?


From: "tom tom" <tomxsllist@xxxxxxxxxxx>
Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [xsl] SSI echo as an attribute value
Date: Thu, 14 Sep 2006 15:14:31 +0100

yes, <a href="&start-comment;fff&end-comment;"/> works! I thought I was taking a safer option by putting it in an xsl:attribute and stupidly didn't try it that way.

FYI when I put it in an xsl:attribute it comes out as:

<a href="%EE%94%81fff%EE%94%82">



From: David Carlisle <davidc@xxxxxxxxx>
Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [xsl] SSI echo as an attribute value
Date: Thu, 14 Sep 2006 14:28:55 +0100

<a>
<xsl:attribute
name="href"><xsl:text>&start-comment;</xsl:text>fff<xsl:text>&end-comment;</xsl:text></xsl:attribute>
</a>
This doesn't work.


It should work I think, although I'd write it as

<a href="&start-comment;fff&end-comment;"/>

Did you specify the character map in xsl:output?

David


_________________________________________________________________
Download the new Windows Live Toolbar, including Desktop search! http://toolbar.live.com/?mkt=en-gb



_________________________________________________________________
Windows Live Messenger has arrived. Click here to download it for free! http://imagine-msn.com/messenger/launch80/?locale=en-gb


Current Thread