#1
  1. Full Access
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jun 2000
    Location
    London, UK
    Posts
    2,019
    Rep Power
    17

    Rendering XSLT output into an URL


    Hi,

    I'm having problems trying to render XSL output into a URL. It seems the problems lie with the characters & and =.

    This XSL code renders fine:

    Code:
    <xsl:template match="stuff">
    
    <a href="stuff/q2_{@set}.htm?qset\={@qset}qcode-{@qcode}">hello</a>
    
    </xsl:template>
    This, however, does not:

    Code:
    <xsl:template match="stuff">
    
    <a href="stuff/q2_{@set}.htm?qset={@qset}&qcode={@qcode}">hello</a>
    
    </xsl:template>
    I get an error complaining about the XSL not being well-formed. I need to use the ampersand and equals characters in order to build my URL correctly. How can I use these characters without causing an error?
    Alex
    (http://www.alex-greg.com)
  2. #2
  3. No Profile Picture
    Python Prophet
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2001
    Location
    Amersfoort, The Netherlands
    Posts
    45
    Rep Power
    14
    You can't just use special characters like the ampersand(&), but you have to replace them with (for example):
    Code:
    &amp;
    ( I had to place it between [code] tags, because vB parsed it too.

    Character Data and Markup
    Some people, when confronted with a problem, think I know, I'll use regular expressions. Now they have two problems. - Jamie Zawinski, in comp.lang.emacs
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2001
    Location
    yes
    Posts
    30
    Rep Power
    14

IMN logo majestic logo threadwatch logo seochat tools logo