Re: cannot force generation of " inside attribute value stri
greg keraunen wrote: > > dear friends, > > I am having a problem producing xml output that includes double-quotes > inside of an attribute value. I'll assume that single quotes don't work. It would actually be nice if XSLT processors occasionally output attributes surrounded by single quotes, as this would solve your problem. What is your output method incidentally - if it is XML or HTML, the quotes are the least of your worries - the '<' at the start of the attribute is much harder to deal with. Anyway, to produce dubious output, you have to resort to dubious methods ... As of saxon 5.4, there is an extension attribute that disables output escaping in attribute values, allowing you to create the kind of invalid output you're looking for. The following stylesheet <?xml version="1.0" encoding="iso-8859-1"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <input type="text"> <xsl:attribute name="value" saxon:disable-output-escaping="yes" xmlns:saxon="http://icl.com/saxon"> <xsl:text><?php echo global_get("vg_answer.qa" ); ?></xsl:text> </xsl:attribute> </input> </xsl:template> </xsl:stylesheet> produces <?xml version="1.0" encoding="utf-8"?> <input type="text" value="<?php echo global_get("vg_answer.qa" ); ?>"/> Hope this helps. -- Warren Hedley XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
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