cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Szymon Stasik <>
Subject [C2] xslt/namespace weird problem
Date Wed, 13 Mar 2002 20:25:54 GMT


I have some weird problem that seems to be cocoon/trax related. Let's 
have two simple files:

bug/src.xml (should be allowed to be much more complicated):

<?xml version="1.0"?>


<?xml version="1.0"?>
<xsl:stylesheet version="1.0" 
<xsl:template match="addsql">
   <execute-query xmlns="">
     <query name="file">SELECT 1 AS bug</query>
<xsl:template match="@*|node()|text()" priority="-1">
     <xsl:apply-templates select="@*|node()"/>

and fragment of sitemap.xmap

<map:match pattern="bug">
  <map:generate src="context://bug/src.xml"/>
  <map:transform src="context://bug/addsql.xsl"/>
  <map:transform type="sql">
   <map:parameter name="use-connection" value="whatever"/>

the output is ... nothing however in the logs I can found everything up to

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

one possible fix is to add implicit

<xsl:template match="root">
     <xsl:apply-templates />

but it is impossible for dynamic xml to hardcode all possible tags ;)

another problem is that while the result after fix looks quite well:
   <rowset name="file">


it is almost impossible to do anything advanced with it (eg add another 
xslt map:transform after sql one) since rowset has different namespace 
than root - even if this cannod be seen after serialisation.

Some debbuging - <map:transform src="context://bug/debug.xsl"/> at end
with debug.xsl:

<xsl:template match="/|*">
   <element name="{name(.)}"

shows that there seems to be a lot of problem - eg diffrent namespaces 
for diffrent elements and even empty element names whit nonempty 
local-names :/

<element local="" namespace="" name="">
<element local="root" namespace="" name="root">
<element local="rowset" namespace="" 
<element local="row" namespace="" name="">
<element local="1" namespace="" 

I was investigating this for an hours but without any resonable ideas 
and digging into even more weirdness like this.

Also please don't send messages like - 'don't use xsl:copy' or 'keep 
your xsl / transformations simple'. I have found few times people 
reporting similar problems but without any solutions. I've tried to use 
either older and latest cvs cocoon.

here are links propably related to this problems:



To unsubscribe, e-mail:
For additional commands, email:

View raw message