You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Pål Wester <pa...@never.no> on 2001/01/29 01:08:51 UTC

esql:get-xml problem

In order to retrieve xml-content from a db
it has to be well-formed. ie.
--start
<xml version="1.0">
<text>
	content
	<b>bold content</b>
</text>
--end

This is an example of text i put in my database... then
I want to edit that text... and since esql
preserves the root-element, I write like this

<esql:get-xml column="xml"/>

this should give me:
<text>
	content
	<b>bold content</b>
</text>

this creates this exception:
java.lang.Exception: XSP Java Compiler: Compilation failed for _edit.java
326: ';' expected.
							this.xspParser.parse(new InputSource(new
StringReader(_esql_query.resultset.getString("tekst")))).getDocumentElement(
)

^
1 error


	at
org.apache.cocoon.processor.xsp.language.java.XSPJavaProcessor.compile(XSPJa
vaProcessor.java:146)
	at ... blablabla

lookes like the statement lacks a ";".... Now if i write the same
tag enclosed in xml like this:
<text>
	<esql:get-xml column="xml"/>
</text>

it compiles successfully with the resulting xml:
<text>
	<text>
		content
		<b>bold content</b>
	</text>
</text>

Now, I can fix this in my xsl, but i thought
matbe someone wants to look at it cause it looks
like a bug in esql..

Pål Wester


Re: esql:get-xml problem

Posted by Donald Ball <ba...@webslingerZ.com>.
On Mon, 29 Jan 2001, [iso-8859-1] P�l Wester wrote:

> This is an example of text i put in my database... then
> I want to edit that text... and since esql
> preserves the root-element, I write like this
>
> <esql:get-xml column="xml"/>
>
> this should give me:
> <text>
> 	content
> 	<b>bold content</b>
> </text>
>
> this creates this exception:
> java.lang.Exception: XSP Java Compiler: Compilation failed for _edit.java
> 326: ';' expected.
> 							this.xspParser.parse(new InputSource(new
> StringReader(_esql_query.resultset.getString("tekst")))).getDocumentElement(
> )

> lookes like the statement lacks a ";".... Now if i write the same
> tag enclosed in xml like this:
> <text>
> 	<esql:get-xml column="xml"/>
> </text>
>
> it compiles successfully with the resulting xml:
> <text>
> 	<text>
> 		content
> 		<b>bold content</b>
> 	</text>
> </text>

(this is the same bug as reported by Sergio Carvalho)

it's because esql:get-xml resulted in an xsp expression, which must be
evaluated in the context of an element in the result tree. i just
committed a patch which tries to work around this by checking to see if
esql:get-xml's parent is esql:row-results and generating different source
if so. check it out of cvs, please, and give it a whirl. thanks.

- donald