Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > XALAN and & in links

Reply
Thread Tools

XALAN and & in links

 
 
Thomas Scheffler
Guest
Posts: n/a
 
      01-05-2005
Hi,

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.

<xslutput 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
http://www.w3.org/TR/1999/REC-xslt-1...-Output-Method
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?

Cheers

Thomas
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Upgrade of Xalan 1.2.2 and Xerces 1.4.4 to Xalan 2.6 and Xerces 2.6.2 cvissy XML 0 11-16-2004 07:06 AM
JBoss and Xalan problem ... Elpecek Java 3 11-03-2004 11:13 PM
wsdeploy and IndexOutOfBoundsExecption in xalan =?ISO-8859-2?Q?Pawe=B3_Poplawski?= Java 2 10-01-2004 07:49 PM
xerces and xalan sp Java 2 09-18-2004 10:34 PM
JDK 1.4.1, Xalan, and extensions Kevin Burges Java 0 05-06-2004 12:00 PM



Advertisments