First I want to specify my goal. I am tasked to show a url concatenated to a constant string particularly '&src=JB-10081' as an attribute of xml tag in the output.
Here is my code:
<vacancy>
<xsl:attribute name = "url">
<xsl:value-of disable-output-escaping="yes" select="concat(apply_url, '&src=JB-10081')"/>
</xsl:attribute>
<vacancy>
This code gives me a result of:
<vacancy id="6747232000011108" datestart="" dateend="" language="" origin="" url="https://dtt.taleo.net/careersection/10540/jobapply.ftl?lang=en-GB&job=27050&src=JB-10081">
you could notice that the URL and the string literal is shown correctly except that the output shown for the string literal was not changed to & and instead shown as & can someone help me to show it as & and not &
I have filled out my answer above. XML has a few reserved characters including '&' . XML uses it to create entity references. Thus
instructs the XML parser to find an enntity with name 'foo'. If you don't use the
&...;
construct you will get an error. Try readinginto any XML parser and it should throw an error. So the output you wish to create is illegal XML.
If you wish to create a NON-XML string, then you will have to output as text.
You can use D-O-E to generate unescaped content only as part of text nodes -- not in attributes.
http://w3.org/TR/1999/REC-xslt-19991116#disable-output-escaping :