|
[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message] dynamic xhtml with xqueryMichael Kay mike at saxonica.comFri Jul 10 20:15:50 PDT 2009
If your input contains escaped markup that you want to treat as markup then you have to unescape it. The easiest way to do that is to put it through an XML parser. Unfortunately there's no standard XQuery function to do that. Saxon has saxon:parse(), other products may have similar extensions, or you may be able to write your own. A better solution is to persuade people not to escape their markup... Regards, Michael Kay http://www.saxonica.com/ http://twitter.com/michaelhkay > -----Original Message----- > From: http://x-query.com/mailman/listinfo/talk > [mailto:http://x-query.com/mailman/listinfo/talk] On Behalf Of Gary Lewis > Sent: 10 July 2009 17:52 > To: http://x-query.com/mailman/listinfo/talk > Subject: dynamic xhtml with xquery > > I'm stuck on a problem that must occur frequently, yet lots > of reading, google searches, and xquery experimentation have > not yet provided a solution. I'm writing in hopes that > someone can point me to an faq or similar info. > > Here's the situation. I'd like to use xquery to write dynamic > xhtml (ie, to write xhtml on-the-fly that can be viewed in a > browser without additional editing). > > I started with a small project involving rss, using zorba's > xquery REST functionality and GET to access the rss (returned > as xml). I then wrote an xquery to serialize the xml and > return xhtml. No problems when displayed in a browser > (Firefox) ... except for special characters. As you'd expect, > the GET returns angle brackets as < and > and since the > rss contains many href links there are many of these < and > > substitutions. The browser renders them correctly as > > and < but, naturally, the resulting href is seen as text and > not as a link. > > I've tried lots of different possible solutions, all of which > I realize now were silly although useful for learning what not to do. > > Any help would be much appreciated. > > Thanks. > > Gary Lewis > _______________________________________________ > http://x-query.com/mailman/listinfo/talk > http://x-query.com/mailman/listinfo/talk
|
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
|






