Re: Displaying HTML code pulled from a database

Martin Klang <[email protected]> Sun, 3 Oct 2004 23:30:20 +0100
Newsgroups gmane.text.xml.o-xml
Message-ID <[email protected]>
On 3 Oct 2004, at 22:51, Glen Barnes wrote:

> Is there anyway to output the proper HTML?

The angle brackets are escaped when the string data is output as XML.
What you can do is parse the string data (using the Java extensions 
parse() function) and output the parse results:

<o:eval select="java:parse($stringdata)"
	   xmlns:java="http://www.o-xml.com/java/"/>

This gets a bit tedious when you have to iterate over rows of results. 
You might find you can do it with a single XPath replace() expression.

It would be better if instead you could specify the data type in the 
result template directly, or if full expressions were allowed. Maybe in 
the next version!

> Also apart from  db:quote() are there any other functions that I can 
> use in the DB extension to format input?

You can use any function or expression as normal, but there currently 
aren't any others defined in the db namespace specifically. What input 
formatting do you need?

hth,

/m