I am using XSLT Transformation and need to put some data in CDATA section and that vale is present in a variable.
Query: How to access variable in CDATA ? Sample Given Below:
<xsl:attribute name ="attributeName">
<![CDATA[
I need to access some variable here like
*<xsl:value-of select ="$AnyVarible"/>*
]]>
</xsl:attribute>
How can I use varibale in CDATA ?
Note: I can not use --> <![CDATA[<xsl:value-of select ="$AnyVarible"/>]]>
Thanks in advance.
CDATA is just text like any other element contents...
But using the
xsl:output
element you should be able to specify which elements are to be written as CDATA with thecdata-section-elements
attribute.EDIT:
Now that there is a valid sample, I guess you mean this:
If you want to include CDATA sections in your output, you should use the cdata-section-elements atribute of xsl:output. This is a list of element names. Any such elements will have their text content wrapped in CDATA.
I got the solution for this...FYI for everyone...