cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Subramonian A <subramonia...@hpsblr.soft.net>
Subject RE: Embedding XML results in an XSP page(might respond to "PI pro blem")
Date Wed, 11 Oct 2000 09:10:11 GMT
Man ,
  How to install cocoon, what are installables required, where i can find
this one ??..pls help..am quite new to cocoon ..

> -----Original Message-----
> From:	YP [SMTP:pedron@club-internet.fr]
> Sent:	Wednesday, October 11, 2000 2:12 PM
> To:	cocoon-users@xml.apache.org
> Subject:	Embedding XML results in an XSP page(might respond to "PI
> problem")
> 
> Hello,
> 
> I felt difficult to embed computed XML in a XSP page.
> 
> 
> 1) Direct text insertion does not work:
> 
> <xsp:logic> String xmlStr = new String ("<Hello> hello world </Hello>"
> ); </xsp:logic> 
> <xsp:expr> xmlStr </xsp:expr>
> 
> Produces a text node that contains "&lt;Hello&gt; hello world
> &lt;/Hello&gt;" that is not processed by XSLT.
> 
> This might be the response to Monica in "PI problem" message.
> 
> 2) The following method works:
>     <!-- Proper imports are expected -->
>    <xsp:logic>
>         <![CDATA[
> 	String xmlStr = new String ("<Hello> hello world </Hello>" )
> 	Reader reader  = new StringReader(xmlStr);
> 	InputSource    inputSource = new InputSource(reader);
> 	Document doc = xspParser.parse(inputSource);
> 	]]>
>   </xsp:logic>
> 
>   <!-- The result is inserted this way -->
>   <xsp:expr> doc.getFirstChild() </xsp:expr>
> 
> 
> I do not understand exactly why "<xsp:expr> doc </xsp:expr>" fails. 
> There is an issue with the document owner that causes a null pointer
> exception in Xerces.
> 
> As I have not found other method, I would appreciate all this stuff
> being handled automatically by the XSP processor. For example, extending
> the <xsp:expr> tag in such a way:
>     <xsp:expr type="xmlstring"> xmlStr </xsp:expr>
> The attribute "type" being used to direct the XSP to parse the string.
> 
> 
> In addition, It is also possible to build a Document Object using the
> DOM API and to insert it in the XSP page using the <xsp:exp> tag (a
> thread can be open on this subject).
> 
> Cheers,
> 
> Yvon
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org

Mime
View raw message