Viktor Štujber wrote:
> This is interesting... could you point me to the part of the spec that
> describes the rules for constructing literals this way?
It’s got nothing (well, little) to do with XSLT; it is a result of the
XML syntax rules.
An attribute value must be bounded by " or '. It may not contain its
bounding characters. However, entity references may be used with an
attribute value:
<anxmlelement anattribute="a value with "quotation marks""
anotherattribute='a value with 'apostrophes''/>
XSLT 1.0 requires string literals to be delimited with " or ', and does
not provide an escape mechanism for those marks to be included.
'a string with "quotation marks"'
"a string with 'apostrophes'"
When a string literal needs to go in an attribute value, the rules must
be combined:
<xsl:value-of
select="'a string with "quotation marks"'"/>
<xsl:value-of
select='"a string with 'apostrophes'"'/>
If you need both quotation marks and apostrophes in a string, you must
use concat().
concat('a string with "quotes" ', "and 'apostrophes'")
<xsl:value-of
select="concat('a string with "quotes" ',
"and 'apostrophes'")"/>
HTH,
Chris
--
Chris Maden, text nerd <URL: http://crism.maden.org/ >
“If Buzz Aldrin really went to the moon, why is he so afraid to
show his real long form birth certificate?” —the Internet
GnuPG Fingerprint: C6E4 E2A9 C9F8 71AC 9724 CAA3 19F8 6677 0077 C319
_______________________________________________
xslt mailing list, project page http://xmlsoft.org/XSLT/
[email protected]
http://mail.gnome.org/mailman/listinfo/xslt