aspose file tools*
The moose likes XML and Related Technologies and the fly likes Escaping special characters with XSLTC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Escaping special characters with XSLTC" Watch "Escaping special characters with XSLTC" New topic
Author

Escaping special characters with XSLTC

Bennett Rainville
Greenhorn

Joined: Feb 16, 2007
Posts: 5
Hello,

I am working on an application that uses XSLT. Some of the transformations we do are quite large, so we are switching to XSLTC to improve performance. I have got most of our transforms to work, but one has me stumped.

One of the things this transform does is convert symbols to their unicode equivalents. Here is a snippet of the transform:



This code worked fine before we switched to XSLTC. However, after the switch, we have been getting an error when the XSL is compiled:

ERROR: line 126: Cannot parse attribute value template '{'.'

Line 126 is the line with the comment LEFT CURLY BRACKET.

Any idea what's going on? I think this is an escaping issue...
[ July 31, 2007: Message edited by: Bennett Rainville ]
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18669
    
    8

The business of curly brackets (a.k.a. curly braces) is covered in section 7.6.2 of the XSLT recommendation. As far as I can see it's trying to say that in an attribute where an Attribute Value Template can be used, you have to escape those curlies by doubling them if you don't intend them to be AVT delimiters.

It's a bit unclear, though, but if you read section 5.6 of the XSLT 2.0 recommendation you'll see it's been clarified as to how curly-escaping is supposed to work.

So it looks like there might be a little bit of non-conforming behaviour in one of your two XSLT processors, but I couldn't say for certain which one.
[ July 31, 2007: Message edited by: Paul Clapham ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Escaping special characters with XSLTC