You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Thomas Richards <tr...@futurenet.co.uk> on 2001/01/02 13:07:41 UTC

Handling XML from SQL query

I'm trying to retrieve some xml fragments using sql by adapting the esql
example like this:

[snip]
<esql:query>select * from visitor</esql:query>
<esql:results>
 <visitor>
  <id><esql:get-string column="id"/></id>
  <userid><esql:get-string column="userid"/></userid>
  <password><esql:get-string column="password"/></password>
  <xmlfrag><esql:get-string column="xmlfrag"/></xmlfrag>
 </visitor>
</esql:results>
[snip]

The line  <xmlfrag><esql:get-string column="xmlfrag"/></xmlfrag> 
returns an XML fragment from the database.

My problem is that after processing by Cocoon, the XML returned to the
<xmlfrag> element has all its angled brackets rendered as &lt; or &gt;
making it useless for further processing using xslt. I've tried numerous
ways of overcoming this & had a look in the archive for clues, but so
far without success.

If anyone can give me some clues on solving this one, I'd be very
grateful!

Many thanks,
Tom Richards