This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: How to use caracter " in a String
- From: "Andrew Welch" <awelch at piper-group dot com>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Tue, 25 Jun 2002 16:28:22 +0100
- Subject: RE: [xsl] How to use caracter " in a String
- Reply-to: xsl-list at lists dot mulberrytech dot com
Tom P:
><xsl:value select='I want to say "Hello"'/>
This won't work
><xsl:value-of select="I want to say "Hello""/>
Nor will this.
><xsl:value-of select " 'I want to say "Hello"' "/>
This will.
(I know you know really Tom, but for everyone else...)
The bit between the quotes is a node test, so when you say:
<xsl:value-of select="worldcup"/>
You are saying 'give me the content of the node <worldcup>', whatever
that may be. If you want the string 'worldcup' in your output [as part
of a select statement] then you need to enclose it in quotes to identify
it as a string:
<xsl:value-of select="'worldcup'"/>
^ ^
This tells the processor its a string and not the name of a node. If
you then want it to be wrapped in quotes in your output, you need to
insert some escaped quotes around it:
<xsl:value-of select="'"worldcup"'"/>
and that will give you "worldcup"
cheers
andrew
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.350 / Virus Database: 196 - Release Date: 17/04/2002
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list