Stuart Roebuck wrote:
>>
>> <?xml version="1.0"?>
>> <xsl:stylesheet version="1.0" 
>> xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
>> <xsl:template match="addsql">
>>   <execute-query xmlns="http://apache.org/cocoon/SQL/2.0";>
>>     <query name="file">SELECT 1 AS bug</query>
>>   </execute-query>
>> </xsl:template>
>> <xsl:template match="@*|node()|text()" priority="-1">
>>   <xsl:copy>
>>     <xsl:apply-templates select="@*|node()"/>
>>   </xsl:copy>
>> </xsl:template>
>> </xsl:stylesheet>
> 
> 
> The definition of XSLT states that:
> 
>> node() matches any node other than an attribute node and the root node
> 
> 
> So this would explain the non-matching of your root node.

root means '/' not '<root>' :) it is not a problem of matching '/' node 
but eg. copying it. At this stage xslt seems to work properly since 
doing serialisation directly after xslt (without sql transformer) 
procues xml that looks fine to my eyes - hovewer passing it to next 
transformation is beeing done without serialization - so some internal 
structure seems to be a problem. Anyway the xml is still passed to the 
sql transformer since I can see

HttpProcessor[8180][2]/SQLTransformer$Query: EXECUTING SELECT 1

in a log file, but it outputs nothing :(

> xsl:copy, as I understand it, makes a copy of the node set matched by 
> the template match.  I wonder if the match on "node()" but not on "*" 
> (representing an element node) means that the resulting copy of the node 
> excludes the uniquely element type attributes of the node.  The 
> definition of xsl:copy indicates that it automatically copies the 
> namespace axis of elements, but perhaps it doesn't if the element is 
> matched as a node?

I've tried yours proposal to be sure, but with same result. It seems to 
me as a very cocoon2 and/or trax specific problem, so help of someone 
that knows well internal cocoon structure is needed.
I can do some debuging but propably I won't be able to prepare 
apriopriate fix even after finding places where something goes wrong.

> This is the copy-all match I regularly use without problem in my 
> stylesheets:
> 
>> <xsl:template match="*|comment()|text()|node()" priority="-1">
>>     <xsl:copy>
>>         <xsl:copy-of select="@*" />
>>         <xsl:apply-templates />
>>     </xsl:copy>
>> </xsl:template>


regards,

Szymon


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

Reply via email to