You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Johannes Hoechstaedter <j....@memocomp.de> on 2008/06/09 16:50:19 UTC

xsl:copy-of select

Hallo everybody,

I have the following problem. I transform an sql statement by a xsl 
stylsheet:
which looks like the following:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:sql="http://apache.org/cocoon/SQL/2.0"
                xmlns:ft="http://apache.org/cocoon/forms/1.0#template">
<xsl:template match="/page">
<html>
  <body>
      <table border = "1">
            <xsl:copy-of select="sql:email"/>
      <xsl:apply-templates/>
    </table>
  </body>
</html>
</xsl:template>
.................................

Everything works fine except the copy-of select statement. I want to 
acces a single field from the sql statement. When I type <xsl:copy-of 
select="."/> cocoon prints the whole resultset to the screen. I already 
tried ${sql:email}, or thing like name()="sql:email", but nothing works 
for me. Thanks for any advice.

The sitemap statement looks like this:

<map:match pattern = "runsql">
         <map:generate src="resource/internal/sql/sql.xml"/>
         <map:transform type="sql">
                    <map:parameter name="use-connection" value="personnel"/>
                    <map:parameter name="show-nr-of-rows" value="true"/>
                    <map:parameter name="clob-encoding" value="UTF-8"/>
         </map:transform>
         <map:transform src="resource/internal/transform2Table.xsl"/>
        <map:serialize type="html"/>
</map:match>

cheers

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


Re: xsl:copy-of select

Posted by Vyacheslav Sedov <vy...@gmail.com>.
look like sql:email is not child of page element - you can use
<xsl:value-of select="name()"/> to determine current node and provide
full path to node or use "descendant::sql:email"


On Mon, Jun 9, 2008 at 7:05 PM, Johannes Hoechstaedter
<j....@memocomp.de> wrote:
> The output is the following:
>
> <sql:rowset nrofrows="..." name="lastmod">
> <sql:row>
> <sql:login_name>name</sql:login_name>
> <sql:email>email</sql:email>
>
> </sql:row>
> <sql:row>
> <sql:login_name>name</sql:login_name>
> <sql:email>email</sql:email>
>
> </sql:row>
> <sql:row>
> <sql:login_name>name</sql:login_name>
> <sql:email>email</sql:email>
>
> </sql:row>
> <sql:row>
> <sql:login_name>name</sql:login_name>
> <sql:email>email</sql:email>
>
> </sql:row>
> <sql:row>
> <sql:login_name>name</sql:login_name>
> <sql:email>email</sql:email>
>
> </sql:row>
> <sql:row>
> <sql:login_name>name</sql:login_name>
> <sql:email>email</sql:email>
>
> </sql:row>
> <sql:row>
> <sql:login_name>name</sql:login_name>
> <sql:email>email</sql:email>
>
> </sql:row>
> </sql:rowset>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

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


Re: xsl:copy-of select

Posted by Johannes Hoechstaedter <j....@memocomp.de>.
Hi,

I solved it by using ${current()}. Thank you :)

cheers

Johannes Hoechstaedter schrieb:
> Sorry Joerg,
>
> When I copy and paste your code <xsl:copy-of 
> select="sql:rowset/sql:row/sql:email"/> nothing happens. :(
>
> Joerg Heinicke schrieb:
>> That makes it <xsl:copy-of select="sql:rowset/sql:row/sql:email"/>. 
>> You have to navigate the tree.
>>
>> Joerg
>>
>> On 09.06.2008 11:05, Johannes Hoechstaedter wrote:
>>> The output is the following:
>>>
>>> <sql:rowset nrofrows="..." name="lastmod">
>>> <sql:row>
>>> <sql:login_name>name</sql:login_name>
>>> <sql:email>email</sql:email>
>>>
>>> </sql:row>
>>> <sql:row>
>>> <sql:login_name>name</sql:login_name>
>>> <sql:email>email</sql:email>
>>>
>>> </sql:row>
>>> <sql:row>
>>> <sql:login_name>name</sql:login_name>
>>> <sql:email>email</sql:email>
>>>
>>> </sql:row>
>>> <sql:row>
>>> <sql:login_name>name</sql:login_name>
>>> <sql:email>email</sql:email>
>>>
>>> </sql:row>
>>> <sql:row>
>>> <sql:login_name>name</sql:login_name>
>>> <sql:email>email</sql:email>
>>>
>>> </sql:row>
>>> <sql:row>
>>> <sql:login_name>name</sql:login_name>
>>> <sql:email>email</sql:email>
>>>
>>> </sql:row>
>>> <sql:row>
>>> <sql:login_name>name</sql:login_name>
>>> <sql:email>email</sql:email>
>>>
>>> </sql:row>
>>> </sql:rowset>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>

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


Re: xsl:copy-of select

Posted by Johannes Hoechstaedter <j....@memocomp.de>.
Sorry Joerg,

When I copy and paste your code <xsl:copy-of 
select="sql:rowset/sql:row/sql:email"/> nothing happens. :(

Joerg Heinicke schrieb:
> That makes it <xsl:copy-of select="sql:rowset/sql:row/sql:email"/>. 
> You have to navigate the tree.
>
> Joerg
>
> On 09.06.2008 11:05, Johannes Hoechstaedter wrote:
>> The output is the following:
>>
>> <sql:rowset nrofrows="..." name="lastmod">
>> <sql:row>
>> <sql:login_name>name</sql:login_name>
>> <sql:email>email</sql:email>
>>
>> </sql:row>
>> <sql:row>
>> <sql:login_name>name</sql:login_name>
>> <sql:email>email</sql:email>
>>
>> </sql:row>
>> <sql:row>
>> <sql:login_name>name</sql:login_name>
>> <sql:email>email</sql:email>
>>
>> </sql:row>
>> <sql:row>
>> <sql:login_name>name</sql:login_name>
>> <sql:email>email</sql:email>
>>
>> </sql:row>
>> <sql:row>
>> <sql:login_name>name</sql:login_name>
>> <sql:email>email</sql:email>
>>
>> </sql:row>
>> <sql:row>
>> <sql:login_name>name</sql:login_name>
>> <sql:email>email</sql:email>
>>
>> </sql:row>
>> <sql:row>
>> <sql:login_name>name</sql:login_name>
>> <sql:email>email</sql:email>
>>
>> </sql:row>
>> </sql:rowset>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>

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


Re: xsl:copy-of select

Posted by Joerg Heinicke <jo...@gmx.de>.
That makes it <xsl:copy-of select="sql:rowset/sql:row/sql:email"/>. You 
have to navigate the tree.

Joerg

On 09.06.2008 11:05, Johannes Hoechstaedter wrote:
> The output is the following:
> 
> <sql:rowset nrofrows="..." name="lastmod">
> <sql:row>
> <sql:login_name>name</sql:login_name>
> <sql:email>email</sql:email>
> 
> </sql:row>
> <sql:row>
> <sql:login_name>name</sql:login_name>
> <sql:email>email</sql:email>
> 
> </sql:row>
> <sql:row>
> <sql:login_name>name</sql:login_name>
> <sql:email>email</sql:email>
> 
> </sql:row>
> <sql:row>
> <sql:login_name>name</sql:login_name>
> <sql:email>email</sql:email>
> 
> </sql:row>
> <sql:row>
> <sql:login_name>name</sql:login_name>
> <sql:email>email</sql:email>
> 
> </sql:row>
> <sql:row>
> <sql:login_name>name</sql:login_name>
> <sql:email>email</sql:email>
> 
> </sql:row>
> <sql:row>
> <sql:login_name>name</sql:login_name>
> <sql:email>email</sql:email>
> 
> </sql:row>
> </sql:rowset>

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


Re: xsl:copy-of select

Posted by Johannes Hoechstaedter <j....@memocomp.de>.
The output is the following:

<sql:rowset nrofrows="..." name="lastmod">
<sql:row>
<sql:login_name>name</sql:login_name>
<sql:email>email</sql:email>

</sql:row>
<sql:row>
<sql:login_name>name</sql:login_name>
<sql:email>email</sql:email>

</sql:row>
<sql:row>
<sql:login_name>name</sql:login_name>
<sql:email>email</sql:email>

</sql:row>
<sql:row>
<sql:login_name>name</sql:login_name>
<sql:email>email</sql:email>

</sql:row>
<sql:row>
<sql:login_name>name</sql:login_name>
<sql:email>email</sql:email>

</sql:row>
<sql:row>
<sql:login_name>name</sql:login_name>
<sql:email>email</sql:email>

</sql:row>
<sql:row>
<sql:login_name>name</sql:login_name>
<sql:email>email</sql:email>

</sql:row>
</sql:rowset>





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


Re: xsl:copy-of select

Posted by Vyacheslav Sedov <vy...@gmail.com>.
can you post here result of <xsl:copy-of select="/*"/>?

On Mon, Jun 9, 2008 at 6:50 PM, Johannes Hoechstaedter
<j....@memocomp.de> wrote:
> Hallo everybody,
>
> I have the following problem. I transform an sql statement by a xsl
> stylsheet:
> which looks like the following:
>
> <?xml version="1.0"?>
> <xsl:stylesheet version="1.0"
>               xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>               xmlns:sql="http://apache.org/cocoon/SQL/2.0"
>               xmlns:ft="http://apache.org/cocoon/forms/1.0#template">
> <xsl:template match="/page">
> <html>
>  <body>
>     <table border = "1">
>           <xsl:copy-of select="sql:email"/>
>     <xsl:apply-templates/>
>   </table>
>  </body>
> </html>
> </xsl:template>
> .................................
>
> Everything works fine except the copy-of select statement. I want to acces a
> single field from the sql statement. When I type <xsl:copy-of select="."/>
> cocoon prints the whole resultset to the screen. I already tried
> ${sql:email}, or thing like name()="sql:email", but nothing works for me.
> Thanks for any advice.
>
> The sitemap statement looks like this:
>
> <map:match pattern = "runsql">
>        <map:generate src="resource/internal/sql/sql.xml"/>
>        <map:transform type="sql">
>                   <map:parameter name="use-connection" value="personnel"/>
>                   <map:parameter name="show-nr-of-rows" value="true"/>
>                   <map:parameter name="clob-encoding" value="UTF-8"/>
>        </map:transform>
>        <map:transform src="resource/internal/transform2Table.xsl"/>
>       <map:serialize type="html"/>
> </map:match>
>
> cheers
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

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


Re: copy-of select

Posted by Johannes Hoechstaedter <j....@memocomp.de>.
Look into my mail before. I solved it.

Thank you

Vyacheslav Sedov schrieb:
> please sent me example of result that you want & i`ll try to resolve
>
> On Tue, Jun 10, 2008 at 11:41 AM, Johannes Hoechstaedter
> <j....@memocomp.de> wrote:
>   
>> Hallo at all,
>>
>> thank you for your advices.
>>
>> @Heather: The output of for example <xsl:copy-of select="sql:email"/> is
>> empty. :)
>>
>> @Vyacheslav: The output of <xsl:value-of select="name()"/> is "sql:email"
>> for example.
>>
>> Which path do I need?
>>
>> Thanks
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>>
>>
>>     
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>
>   

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


Re: copy-of select

Posted by Vyacheslav Sedov <vy...@gmail.com>.
please sent me example of result that you want & i`ll try to resolve

On Tue, Jun 10, 2008 at 11:41 AM, Johannes Hoechstaedter
<j....@memocomp.de> wrote:
> Hallo at all,
>
> thank you for your advices.
>
> @Heather: The output of for example <xsl:copy-of select="sql:email"/> is
> empty. :)
>
> @Vyacheslav: The output of <xsl:value-of select="name()"/> is "sql:email"
> for example.
>
> Which path do I need?
>
> Thanks
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

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


Re: copy-of select

Posted by Johannes Hoechstaedter <j....@memocomp.de>.
Hallo at all,

thank you for your advices.

@Heather: The output of for example <xsl:copy-of select="sql:email"/> is 
empty. :)

@Vyacheslav: The output of <xsl:value-of select="name()"/> is 
"sql:email" for example.

Which path do I need?

Thanks

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


RE: copy-of select

Posted by Heather Rankin <He...@bbc.co.uk>.
Hi Johannes,

You say Cocoon copies everything through when you use <xsl:copy-of
select="."/>, but what happens when you use <xsl:copy-of
select="sql:email"/>? What does your source SQL XML look like? 

I suspect the xpath in your <copy-of select /> probably just needs a
little adjusting, but without seeing your source XML it's hard to say
for sure.

Heather

-----Original Message-----
From: Johannes Hoechstaedter [mailto:j.hoechstaedter@memocomp.de] 
Sent: 09 June 2008 15:50
To: users@cocoon.apache.org
Subject: xsl:copy-of select

Hallo everybody,

I have the following problem. I transform an sql statement by a xsl
stylsheet:
which looks like the following:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:sql="http://apache.org/cocoon/SQL/2.0"
                xmlns:ft="http://apache.org/cocoon/forms/1.0#template">
<xsl:template match="/page">
<html>
  <body>
      <table border = "1">
            <xsl:copy-of select="sql:email"/>
      <xsl:apply-templates/>
    </table>
  </body>
</html>
</xsl:template>
.................................

Everything works fine except the copy-of select statement. I want to
acces a single field from the sql statement. When I type <xsl:copy-of
select="."/> cocoon prints the whole resultset to the screen. I already
tried ${sql:email}, or thing like name()="sql:email", but nothing works
for me. Thanks for any advice.

The sitemap statement looks like this:

<map:match pattern = "runsql">
         <map:generate src="resource/internal/sql/sql.xml"/>
         <map:transform type="sql">
                    <map:parameter name="use-connection"
value="personnel"/>
                    <map:parameter name="show-nr-of-rows" value="true"/>
                    <map:parameter name="clob-encoding" value="UTF-8"/>
         </map:transform>
         <map:transform src="resource/internal/transform2Table.xsl"/>
        <map:serialize type="html"/>
</map:match>

cheers

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


http://www.bbc.co.uk/
This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated.
If you have received it in error, please delete it from your system.
Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately.
Please note that the BBC monitors e-mails sent or received.
Further communication will signify your consent to this.
					

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