How to represent '&' as a variable in xslt file

Discussion in 'XML' started by ofuuzo1@yahoo.no, Apr 18, 2008.

  1. Guest

    Hi,

    I have tried the following but it do not work:

    <xsl:variable name="path1" select="string('&')"/>
    <xsl:variable name="path1" select="string('&')"/>
    <xsl:variable name="path1" select="&"/>

    Thanks in advance
    Ofuuzo
    , Apr 18, 2008
    #1
    1. Advertising

  2. wrote:

    > I have tried the following but it do not work:
    >
    > <xsl:variable name="path1" select="string('&')"/>


    <xsl:variable name="path1" select="'&amp;'"/>




    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Apr 18, 2008
    #2
    1. Advertising

  3. Martin Honnen wrote:
    > <xsl:variable name="path1" select="'&amp;'"/>


    That should be equivalent to select="'&'", of course.

    (The trick here is the double-quoting. Select is interpreted as an
    XPath... and the XPath syntax wants its own layer of quotes to indicate
    that you're trying to express a literal value.)
    Joseph J. Kesselman, Apr 18, 2008
    #3
  4. In article <>,
    <> wrote:

    ><xsl:variable name="path1" select="string('&')"/>
    ><xsl:variable name="path1" select="&"/>


    Those won't work because they're not well-formed XML.

    ><xsl:variable name="path1" select="string('&')"/>


    That should work: what error do you get?

    The simplest solution is

    <xsl:variable name="path1" select="'&'"/>

    -- Richard
    --
    :wq
    Richard Tobin, Apr 18, 2008
    #4
    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. TB
    Replies:
    2
    Views:
    322
  2. Benjamin Hillsley
    Replies:
    3
    Views:
    1,658
    Dimitre Novatchev
    Sep 25, 2003
  3. bartek
    Replies:
    7
    Views:
    317
    bartek
    May 21, 2004
  4. beginner16
    Replies:
    2
    Views:
    648
    A. Bolmarcich
    Aug 1, 2007
  5. Olivia Dou
    Replies:
    3
    Views:
    90
    Trans
    Dec 13, 2006
Loading...

Share This Page