[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Copy CDATA nodes from XML to XML format w/ XALAN
I added a call-template element to the <xsl:template match="text()"> example you gave, and can now succesfully perform some search/replace on the output being generated. More specifically I can escape all quotes contained in the text elements within data element. Ie. the following <data> <a> <b>"Bub"</b> </a> </data> Gets translated to <a><b>\"Bub\"</b></a> - which is what I want it to. But if one of the descendants of the data element contain an attribute, I need to escape the quotes used there as well, eg. <data> <a> <b foo="bar">"Bub"</b> </a> </data> Should become <a><b foo=\"bar\">\"Bub\"</b></a> - I'm beginning to doubt if this is at all possible as it's no longer "just content", but syntax I'm messing with (sort of). I tried using my search/replace template directly on the output from the copy elements, but that just resulted in all tagged elements getting filtered away. I would prefer if there was some way to just treat the content of the data element like a string value, there's no way to have copy-of to copy the current node to a variable rather than the output (or something similar)? Thanks, Morten 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
|