Hi,

I don't know how to do it cocoon, but basically you need to convert the string
to a nodeset (a DOM Node) making sure you set the
javax.xml.parssers.DocumentBuilderFactory to your parser's version. Then
setParameter on the transformer to pass the nodeset in as a top-level param to
the transformation.

best,
-Rob


> -----Original Message-----
> From: Johannes Wechsler
> [mailto:[EMAIL PROTECTED]]
> Sent: Friday, September 06, 2002 7:59 AM
> To: [EMAIL PROTECTED]
> Subject: Formatting strings in a xsl
>
>
> Hi,
> I use a webservice to access the Xindice-database. The URL I access is:
> http://localhost:8004/glue/DBServer/xPathQuery?collectionName=johannes2&quer
> yString=//projects
>
> The method "xPathQuery" returns the (nearly) the following string:
> <projects>
>    <projectName>Test 1</projectName>
>      <description>Erstes Projekt</description>
>      <projectLeader>Die erste Person</projectLeader>
> </projects>
>
> The code of the xsp which calls the webservice is listed below:
>
> <xsp:logic>
>    String key;
>
>    public void start()
>    {
>       BufferedReader in = new BufferedReader( new InputStreamReader (
> webserviceURL.openStream() ) );
>       key = "";
>       while ( ( s = in.readLine() ) != null )
>       { key += s; }
>       in.close();
>
>       return key;
>    }
> </xsp:logic>
>
> <projects>
>    <xsp:expr> start() </xsp:expr>
> </projects>
>
> My problem is that the following xsl doesn't recognize the received string
> as a valid xml document and commands like <xsl:value-of
> select="projectLeader"/> ignore my string. I want to format the received
> string via my xsl, but that doesn't function.
>
> Can anyone help me?
>
> Regards,
> Johannes
>
>
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail:     <[EMAIL PROTECTED]>
> For additional commands, e-mail:   <[EMAIL PROTECTED]>
>



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

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

Reply via email to