[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] "Smart Quotes"
Supposing you have as input <p>She said, "Don't you do that!"</p> is there a way to convert the double and single quotes to "smart quotes"? In other words, substitute the opening " with “ (HTML's "special" entity “), the closing " with ” (”), and the single ' with ’ (’). The desired result should end up something like: <p>She said, “Don’t you do that!”</p> Is there a way to do this using XSL, without pre-processing the XML document first using some other tool? It would be easy if the fragment read something like <p>She said, <q>Don<rsquo/>t you do that!</q></p> but if you don't have the luxury of such input, can it be done in XML+XSLT? You would have to examine all #PCDATA with contains(), maybe use translate()(?) for the single quotes (assuming here, of course, that you always want a *right* single quote), but how would you handle the balanced double quotes? Is this one of those things that needs to wait until XSLT has regular expressions? Thanks, /Jelks 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
|