[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Fwd: curly braces
Ihe,
Your stylesheet contains the element <this:fieldName elem="productThumbnail" plural="thumbnails" bracketType="{{"/> as part of the definition of a global variable. If this is executed as a literal result element the result will be the element <this:fieldName elem="productThumbnail" plural="thumbnails" bracketType="{"/> (with a single "{"). But you are not executing it as a literal result element, you are reading it from the source XML of the stylesheet using the function call doc(''). In elements read from source documents, curly braces have no special significance, so "{{" represents itself. If the element were in a normal source document, then bracketType="{" would work fine, but because the element has a dual role (as an element in a source document and as a literal result element in a stylesheet), bracketType="{" is an error. The idea of reading the source document using document('') is a hack used in XSLT 1.0 to get around the restrictions on using result tree fragments. It is never needed in XSLT 2.0: use the global variable directly. (It's also a very inefficient hack, because the stylesheet has to be parsed twice.) Michael Kay Saxonica On 19/09/2012 12:03, Michael Kay wrote: Could you please construct a complete example that demonstrates the problem? We haven't been able to reproduce it.
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|