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

O

ofuuzo1

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
 
J

Joseph J. Kesselman

Martin said:
<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.)
 
R

Richard Tobin

<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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top