You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Samuel Bruce <bp...@yahoo.com> on 2003/03/11 19:22:44 UTC

Accessing nrofrows from SQL Transformer within Stylesheet

Hello,

I can't seem to access the nrofrows value returned
from the SQL Transformer.

The resulting XML after the SQL Transformer executes
in my pipeline is as follows:

<records>
  <rowset xmlns="http://apache.org/cocoon/SQL/2.0"
nrofrows="4">
    <row>
       ...
    </row>
    <row>
       ...
    </row>
    <row>
       ...
    </row>
    <row>
       ...
    </row>
  </rowset>
</records>

My stylesheet snippet is:
<xsl:template match="records">
  <NumberOfRows>
    <xsl:value-of select="sql:rowset/@nrofrows"/>
  </NumberOfRows>
</xsl:template>

I have no problem accessing the sql rows, but I cannot
access the nrofrows attribute. What am I doing wrong?

I'm using a cocoon2 dev. snapshot from October, 2002
and TC 4.1.12.





__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


RE: Accessing nrofrows from SQL Transformer within Stylesheet

Posted by Samuel Bruce <bp...@yahoo.com>.
Thanks very much. That worked.

I tried the sql namespace prefix before but I put it
in the wrong place. Previously I used sql:@nrofrows.

Thanks again.

--- Luca Morandini <lu...@tin.it> wrote:
> > -----Original Message-----
> > From: Samuel Bruce [mailto:bperryman_us@yahoo.com]
> > Sent: Tuesday, March 11, 2003 7:23 PM
> > To: cocoon
> > Subject: Accessing nrofrows from SQL Transformer
> within Stylesheet
> > 
> > 
> 
> > 
> > My stylesheet snippet is:
> > <xsl:template match="records">
> >   <NumberOfRows>
> >     <xsl:value-of select="sql:rowset/@nrofrows"/>
> >   </NumberOfRows>
> > </xsl:template>
> > 
> > I have no problem accessing the sql rows, but I
> cannot
> > access the nrofrows attribute. What am I doing
> wrong?
> > 
> 
> try using the "sql" namespace as prefix to
> attributes as well as element names), like in:
> <xsl:value-of select="sql:rowset/@sql:nrofrows"/>
> 
> Regards,
> 
> --------------------------------------------- 
>                Luca Morandini 
>                GIS Consultant 
>               lmorandini@ieee.org 
> http://utenti.tripod.it/lmorandini/index.html 
> ---------------------------------------------
>  
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail:
> cocoon-users-help@xml.apache.org
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


RE: Accessing nrofrows from SQL Transformer within Stylesheet

Posted by Luca Morandini <lu...@tin.it>.
> -----Original Message-----
> From: Samuel Bruce [mailto:bperryman_us@yahoo.com]
> Sent: Tuesday, March 11, 2003 7:23 PM
> To: cocoon
> Subject: Accessing nrofrows from SQL Transformer within Stylesheet
> 
> 

> 
> My stylesheet snippet is:
> <xsl:template match="records">
>   <NumberOfRows>
>     <xsl:value-of select="sql:rowset/@nrofrows"/>
>   </NumberOfRows>
> </xsl:template>
> 
> I have no problem accessing the sql rows, but I cannot
> access the nrofrows attribute. What am I doing wrong?
> 

try using the "sql" namespace as prefix to attributes as well as element names), like in:
<xsl:value-of select="sql:rowset/@sql:nrofrows"/>

Regards,

--------------------------------------------- 
               Luca Morandini 
               GIS Consultant 
              lmorandini@ieee.org 
http://utenti.tripod.it/lmorandini/index.html 
---------------------------------------------
 

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org