A
Arne Schirmacher
I want to display a MySQL database field that can contain HTML markup.
If I use <esql:get-string> then I get all of the database field, but
all tags are escaped which is not what I want. If I use <esql:get-xml>
the tags are not escaped, but only the first part of the database
field is displayed.
The content of the database field is:
"<h1>Title</h1><h2>Subtitle</h2>"
Here is my xsp page:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xspage language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:esql="http://apache.org/cocoon/SQL/v2"
<page>
<title>Test</title>
<content>
<esql:connection>
<esqlool>abc</esqlool>
<esql:execute-query>
<esql:query>
select * from blocks
</esql:query>
<esql:results>
<text>
<esql:row-results>
<esql:get-string column="block"/>
</esql:row-results>
</text>
</esql:results>
</esql:execute-query>
</esql:connection>
</content>
</page>
</xspage>
This xsp page generates:
....
<text>
<h1>Title</h1><h2>Subtitle</h2>
</text>
....
When I use <esql:get-xml column="block"/> then the output changes to:
....
<text>
<h1>Title</h1>
</text>
....
Note that the "Subtitle" string is gone. Why? What can I do to get all
of the database field in the xml output?
If I use <esql:get-string> then I get all of the database field, but
all tags are escaped which is not what I want. If I use <esql:get-xml>
the tags are not escaped, but only the first part of the database
field is displayed.
The content of the database field is:
"<h1>Title</h1><h2>Subtitle</h2>"
Here is my xsp page:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xspage language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:esql="http://apache.org/cocoon/SQL/v2"
<page>
<title>Test</title>
<content>
<esql:connection>
<esqlool>abc</esqlool>
<esql:execute-query>
<esql:query>
select * from blocks
</esql:query>
<esql:results>
<text>
<esql:row-results>
<esql:get-string column="block"/>
</esql:row-results>
</text>
</esql:results>
</esql:execute-query>
</esql:connection>
</content>
</page>
</xspage>
This xsp page generates:
....
<text>
<h1>Title</h1><h2>Subtitle</h2>
</text>
....
When I use <esql:get-xml column="block"/> then the output changes to:
....
<text>
<h1>Title</h1>
</text>
....
Note that the "Subtitle" string is gone. Why? What can I do to get all
of the database field in the xml output?