Title: Glacier
Found the answer to my problem in the news group archives, actually. I was looking for nearly a day without knowing -what- I should search for; finally today it clicked! (veterans, please don't get annoyed, I am new to the list too :))
 
After duly 'importing' the Util style sheet, I did the following in my logic sheet:
<xsl:template match="singertags:get-name">
    <util:include-expr>
        <util:expr>
            <xsp:expr>
                SingerHelper.getAllSingers().asXML()
            </xsp:expr>
        </util:expr>
    </util:include-expr>
</xsl:template>
I guess Cocoon sees SingerHelper.getAllSingers().asXML() as XML-to-be-parsed only if  it is used to fire off SAX events!
 
Sreedhar
-----Original Message-----
From: Sreedhar Chintalapaty [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 26, 2002 7:26 PM
To: Cocoon Users
Subject: <xsp:expr> related problem?

Hi,
 
This is going to be rather long-winded, please bear with me. :)
 
I have a java class that returns a result set as XML. I am calling it in a logic sheet like so:
<xsl:template match="singertags:get-all-singers">
    <xsp:expr>
        SingerHelper.getAllSingers().asXML()
    </xsp:expr>   
    <Singers><Singer name="GHI" born="1900-10-29" died="1980-11-09"/></Singers>
</xsl:template>
The value of SingerHelper.getAllSingers().asXML() is
            <Singers>
                <Singer name="ABC" born="1900-10-12" died="1970-11-23"/>
                <Singer name="DEF" born="1920-08-2" died="1990-10-26"/>
            </Singers>
 
I have a singers.xsl style sheet that takes the <Singers>...</Singers> and formats them as a table. The matcher in sitemap applies the style sheet:
<map:match pattern="xsp/singerslist.xml">
    <map:generate type="serverpages" src="content/singerslist.xml"/>
    <map:transform type="xslt" src="view/singers.xsl"/>
    <map:serialize/>
</map:match>
 
My problem is: the stuff returned within <xsp:expr> is coming not transformed by singers.xsl, but the the XML fragment <Singers><Singer name="GHI" born="1900-10-29" died="1980-11-09"/></Singers> is. How come?
<article>
This is a song written and set to music by <?xml version="1.0" encoding="UTF-8"?> <Singers><Singer name="ABC" born="1900-10-12" died="1970-11-23"/><Singer name="DEF" born="1920-08-02" died="1990-10-26"/></Singers>
    <table border="0" cellspacing="0" cellpadding="3">
        <tr bgcolor="#C0C0C0">
          <td>Name</td>
          <td>Born</td>
          <td>Died</td>
        </tr>
        <tr>
          <td>GHI</td>
          <td>1900-10-29</td>
          <td>1980-11-09</td>
        </tr>
    </table>
</article> 
 
I would greatly appreciate -any- help in solving this, I cannot move forward in my project without getting this done!
 
Best Regards,

Sreedhar Chintalapaty
__________________________________________________________________________________________
A computer is like an Old Testament god, with a lot of rules and no mercy - Joseph Campbell

 

Reply via email to