[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Unescaping < and >
Hi Arthur,
At 05:14 PM 6/24/2003, you wrote: Is there any way of unescaping a "<" and ">" from a text() element. No, although one occasionally hears rumors of extension elements to parse inline text-with-pseudo-markup into node structures. (Note you really need a node subtree, not a string of markup. The XSLT processor doesn't deal with markup and has no interest in it: all parsing has been done for it up front. Hence, you're not really asking for anything to be "unescaped" ... you're really asking for your text node to be parsed.) I'd like to re-inject what is supposed to be xml, but is provided instead as escaped text within document elements. This is an insidious and highly doubtful practice, both practically and in principle, but surprisingly common, leaving you with an ugly requirement. :-> (How do you know the stuff is well-formed? If the process guarantees it, then why not just fold it in as XML instead of disguising it as text-with-angle-brackets? If it doesn't, why are we pretending/hoping it does? I have yet to see a convincing use case for this.) If you're using Saxon, I think later versions have an extension you can use, that returns a node set for a string. Otherwise, I couldn't say. You could use a pre-process to unescape the characters before parsing, and thereby run the risk of breaking your documents irremediably. I've tried modifying the identity transform It won't help. XSLT is designed to keep your mitts off the markup. On balance, this is a good thing. (Angle bracket mungling is really not so fun after a month or three.) Note that what appears as "& g t ;" in a document *is* an angle bracket ">" -- but not a markup delimiter (that's the point). This question comes up from time to time so someone else may have a more helpful answer. Cheers, Wendell
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
|