XALAN and & in links

Discussion in 'XML' started by Thomas Scheffler, Jan 5, 2005.

  1. 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.

    <xsl:eek:utput 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-19991116#section-HTML-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
     
    Thomas Scheffler, Jan 5, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matthew

    &amp; in links

    Matthew, Jul 1, 2004, in forum: HTML
    Replies:
    5
    Views:
    536
    Steve Pugh
    Jul 3, 2004
  2. Lemming
    Replies:
    3
    Views:
    442
    Lemming
    Oct 20, 2004
  3. cvissy
    Replies:
    0
    Views:
    623
    cvissy
    Nov 16, 2004
  4. Tony

    & and &amp;

    Tony, May 4, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    440
    Michael Nemtsev
    May 4, 2007
  5. Versteijn

    TemplateColumn, HyperLink and &Amp

    Versteijn, Oct 20, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    111
    Versteijn
    Oct 20, 2004
Loading...

Share This Page