How do I use curly brackets in an XSL which generates an Excel file from an XML?
I can accomplish what I want with an Excel formula, but it needs to use curly brackets list like:
=LOOKUP(XXXX, {"NA","NF","NR","O"},{"NA","Completed","NR","Ongoing"}
Which I can not get the XSL to accept even when using the HTML indicators for the brackets and commas, I still get an error on the first comma after the first curly bracket.
=LOOKUP(XXXX,{"NA","NF","NR","O"},{"NA","Completed","NR","OngoingNA"})
&123; = {
&#$$; = , (comma)
But I get an XML Error on the first command saying: "Expected token '{' found ','.
=LOOKUP(XXXX,{"NA"-->,<--"NF,"NR","O"},{"NA","Completed","NR","Ongoing","NA"})
I am guessing (!) you are trying to create a literal result element with an attribute containing curly braces. This is problematic, because the curly braces are interpreted as an attribute value template - i.e. the XSLT processor tries to evaluate the expression contained within.
To avoid this, you must either escape the curly braces by doubling them, or use the
xsl:attribute
instruction to specify the value as text. For example, both:and:
will return the same result: