|
Subject: [xsl] Attribute value quoting with Saxon8 From: Victor Toni <xsl-list@xxxxxxxxx> Date: Fri, 19 Aug 2005 22:51:32 +0200 |
I am trying to change some web pages for an embbeded device from ancient HTML to XML which should ease changes of the resulting pages. The resulting pages will be _not_ valid HTML because they are parsed by the HTTP server of the device and then the hopefully valid result will be returned to the browser.
However I have some trouble to create attributes which values are in double qoutes if the value itself contains double qoutes.
My environment:
JDK 1.5.0_04 (on WinXP)
Saxon-B 8.5Kindest regards, Victor
test.xml ------------------
<test> <a> <attribute name="href"><![CDATA[<% get_href(); %>]]></attribute> <text>Works</text> </a>
<a>
<attribute name="href"><![CDATA[<% get_value("href"); %>]]></attribute>
<text>Doesn't work as expected</text>
</a>
</test>
test.xsl ------------------
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" >
<xsl:output encoding="UTF-8" method="xhtml" indent="yes" use-character-maps="cm1" />
<xsl:character-map name="cm1"> <xsl:output-character character=" " string="&nbsp;"/> <xsl:output-character character="" string="<"/> <xsl:output-character character="" string=">"/> <xsl:output-character character="" string="&"/> <xsl:output-character character="" string="""/> </xsl:character-map>
test-result.html ------------------
<?xml version="1.0" encoding="UTF-8"?><test>
<a href="<% get_href(); %>">
<text>Works</text>
</a>
<a href='<% get_value("href"); %>'>
<text>Doesn't work as expected</text>
</a>
</test>test-expected.html ------------------
<?xml version="1.0" encoding="UTF-8"?><test>
<a href="<% get_href(); %>">
<text>Works</text>
</a>
<a href="<% get_value("href"); %>">
<text>Doesn't work as expected</text>
</a>
</test>| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| [xsl] Displaying time in UTC on xsl, Meena Nanjundeswar | Thread | RE: [xsl] Attribute value quoting w, Michael Kay |
| RE: [xsl] output encoding problem (, Gabriel K | Date | Re: [xsl] output encoding problem (, Jonas Lundberg |
| Month |