473,397 Members | 1,960 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

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

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

Jun 27 '08 #1
3 2156
of*****@yahoo.no 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/
Jun 27 '08 #2
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.)
Jun 27 '08 #3
In article <a3**********************************@d1g2000hsg.g ooglegroups.com>,
<of*****@yahoo.nowrote:
><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
Jun 27 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Johnny Ooi | last post by:
I have two XML documents I want to refer to in my XSL sheet, but I'm having problems accessing them. I want to access them both using the document() function (or something similar that allows me to...
4
by: el_bandido | last post by:
Hello, I've tried the FAQ and some minutes in googl'ing but was not happy with what I got. Basically I'd like to get a _simple_ example on how I could create a web based (portable across all...
12
by: Sammy | last post by:
Hi, my mind is going crazy. I have tried everything I can think of to no avail. I have tried Disable Output Escaping. I tried to think of a way of enclosing the attribute data in a CDATA...
2
by: Bond13579 | last post by:
Hi! I'm not an expert in XSL and XHTML so I need a little help! I have an XSL file that ends up using the ENTITY (varname) SYSTEM (file.xhtml) and then calls this variable which in turn outputs...
4
by: Cathie | last post by:
Hi All, I am trying to get my style sheet to work. It works fine in IE but I can't get it to work in .net. Below is the function I use for transforming, where advancedOptionsFile is the path...
6
by: Maxim Kazitov | last post by:
Hi, I try to use document() function in XSLT, but looks like .Net XSLT parser don't try to resolve external URL. Does any body know what can be wrong here : ...
0
by: Omatase | last post by:
I have an xslt file I need to open at runtime. Here is my configuration: main assembly (dll) |-----xslt file unit test assembly I have a reference to my main assembly in my unit test...
10
by: Bilal | last post by:
Hello, I'm trying to perform some string manipulations in my stylesheet and have gotten stuck on the issue below so hopefully can elicit some useful hints. Namely, the problem is that I need to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.