Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I want to output single quote around $ID variable in the below xsl:value-of xsl statment.

<xsl:value-of select="concat('process[@Ref=',$ID,']')"></xsl:value-of>

currently it prints

process@Ref=87799989

Please let me know how can i achieve this.

Thanks in advance, Keshav

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.1k views
Welcome To Ask or Share your Answers For Others

1 Answer

In XPath 1.0:

You can use the built-in entities &apos; and &quot;

In XSLT 1.0:

Alternatively, you can define your $Q and $APOS variables (put the content (the literal " or the literal ' character) in the body of the xsl:variable, not in the select attribute).

In XPath 2.x (this also means XSLT 2.x and XQuery 1.x)

Simply escape an apostrophe by entering two adjacent apostrophes, escape a quote by entering two adjacent quotes, as defined by the XPath 2.0 language


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...