470,848 Members | 2,658 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,848 developers. It's quick & easy.

XALAN and & in links


I runned in trouble using XALAN for XSL-Transformation.
The following snipplet show what I mean:
<a href="http://blah.com/?test=test&amp;test2=test2">Test1&amp;</a>
<a href="http://blah.com/?test=test&amp;amp;test2=test2">Test2&amp;amp;</a>

This results in the following HTML Code:
<a href="http://blah.com/?test=test&test2=test2">Test1&amp;</a>
<a href="http://blah.com/?test=test&amp;test2=test2">Test2&amp;amp;</a>

As you see XALAN is acting different on wether the "&amp" is inside a
link, or just final text. Notice that in first href &amp; is transformed
to & while the link text element contains the proper &amp; as in the
xsl. The second link is just to show the otherway around - more or less.
I'm using XALAN 2.6 for Java and this is my output definition.

<xsl:output method="html" indent="yes" encoding="UTF-8"
media-type="text/html" doctype-public="-//W3C//DTD HTML 4.01//EN"
doctype-system="http://www.w3.org/TR/html4/strict.dtd" />

Is XALAN acting conform to the standard? I just found on
that it should keep the "&amp;" for html output, which it does only for
the link text, but not the href attribute.

My Problem: I put correct links in and the result is not HTML conform,
while the &-sign is not correctly masked. Is that the standard behaviour
with all XSLT processors? If so, what is an easy workaround for that issue?


Jul 20 '05 #1
0 2206

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Collin VanDyck | last post: by
1 post views Thread by Francesc Guim Bernat | last post: by
3 posts views Thread by shaun roe | last post: by
reply views Thread by geoffblanduk_nospam | last post: by
10 posts views Thread by Bilal | last post: by
2 posts views Thread by MV84 | last post: by
2 posts views Thread by alex masselot | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.