简体   繁体   中英

How do I set get variables in xslt?

I have the following problem while working in XSLT:

I want to make this link:

<a href="http://www.website.com/product?title=example&number=09">Click me</a>

..in XSLT...

But I have no idea how. Right now it doesn't work because XSLT does not know the get symbols as ''? and '&'.

Thank you

& -> &amp;
" -> &quot;

Reference: http://www.w3.org/TR/REC-xml/#syntax

<a href="http://www.website.com/product?title=example&amp;number=09">Click me</a>

or

<a href="{$vUrlPath}?title={$vTitle}&amp;number={$vNum}">Click me</a>

where The variables above have the necessary values.

In XML the following characters must be always escaped, whenever they are not within a comment and are not used in their XML role (denoting markup or entity reference):

< --> &lt;

& --> &amp;

You need to use the escape characters for special characters:

http://www.dpawson.co.uk/xsl/sect2/N2215.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM