Take a look at the generate Java class behind the XSP page - and you
will see the problem. get-xml does not an xml string, but a xml dom
element object (or sax events in cocoon 2). In your second case there
was just the .toString()-Method of org.w3c.dom.Element called.

I can see not much sense in putting the xml fragment in a string (i
think you had some misleading thinking here), but if you really need it,
just use get-string instead of get-xml, this returns the plain text of
the column.

Stefan

> -----Ursprüngliche Nachricht-----
> Von: Brent L Johnson [mailto:[EMAIL PROTECTED]]
> Gesendet: Dienstag, 21. August 2001 01:16
> An: Cocoon-Users
> Betreff: esql, get-xml and xsp:logic
> 
> 
> I've been using <esql:get-xml column="COLNAME" 
> root="fragment"/> and it's
> been working perfectly.  But, I've found a problem when 
> trying to set a
> String inside an <xsp:logic> tag to that.  Make any sense?  
> Here's the code
> that works...
> 
> <esql:row-results>
> TEST: <esql:get-xml column="mycol" root="fragment"/>
> </esql:row-results>
> 
> But, I want to set a string to that value.. e.g.
> <xsp:logic>
> String myval = <esql:get-xml column="mycol" root="fragment"/>;
> </xsp:logic>
> 
> Doing this I get the following error:
> Incompatible type for =. Can't convert org.w3c.dom.Element to
> java.lang.String.
> 
> Then I tried this (which ALMOST works):
> <xsp:logic>
> String myval = "" + <esql:get-xml column="mycol" root="fragment"/>;
> </xsp:logic>
> 
> Unfortunately - this only gives me the string "[fragment: 
> null]".  Does this
> have something to do with the order that the XSP and XSL is 
> processed???
> 
> Thanks,
> 
> - Brent

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to