[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] JSON strings in XML attributes
The hipsters at Amazon had the brilliant idea to cram JSON into HTML
attributes in their KF8 format, such as in
<a class="app-amzn-magnify" data-app-amzn-magnify='{targetId:"fs1-txt2-magTarget", sourceId:"fs1-2-txt", ordinal:1}'> (Using a distinct custom attribute for each property in the flat JSON structure apparently wasnt an option for them.) Since we are using XSLT to generate the HTML, strings in JSON have to be double-quote-delimited, the KF8 renderer apparently doesnt parse " to ", our XSLT processor uses double quotes as attribute delimiters by default: Is there a way to tell an XSLT 2 processor to serialize attribute delimiters as single quotes and keep double quotes unescaped in attribute values? Otherwise, wed have to resort to some string postprocessing of the serialized XML. Gerrit
|
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
|