cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Heinicke <joerg.heini...@gmx.de>
Subject Re: content aggregation + links to used files
Date Wed, 07 Jan 2004 11:48:14 GMT
On 07.01.2004 12:26, Nele Vogel wrote:

> Hello!
> 
> I changed my stylesheet news.xsl as Joerg suggested using prefixed
> matching, but unfortunately it still doesn't work.
> 
> In my pipeline I use a directory generator to process all files. The
> output belongs to the namespace
> xmlns:dir="http://apache.org/cocoon/directory/2.0".
> 
> <dir:directory name="news">
>   <dir:file name="news0.xml"/>
>   <dir:file name="news1.xml"/>
> </dir:directory>
> (Note: I deleted some attriubtes.)
> 
> The stylesheet cincludeFiles.xsl uses prefixed matching - its the same
> kind of problem, isn't it? This template matches as expected, the one in
> news.xsl doesn't.

But you do not put <dir:file/> elements out in cincludeFiles.xsl, do 
you? When you send the stylesheets the first time to the list, you put 
out <file/> elements in the default namespace "http://sevencs.com". In 
news.xsl you must match on prefix:file, where the prefix is bound to the 
default namespace od cincludeFiles.xsl, i.e. "http://sevencs.com".

Joerg

>>Well, in that case it is b/c the ouput must be namespace less if I remember
>>right
>>Le Mercredi 07 Janvier 2004 02:13, Joerg Heinicke a écrit :
>>
>>>I don't think, simply removing all namespaces is a good solution,
> 
> though the namespace might not be needed here. Furthermore this
> approach slows down the processing through an additional transformer
> step where it is not necessary.
> 
>>>Her problem is the output of cincludeFiles.xsl in the default
> 
> namespace. Matching on such elements has to be done in XSLT prefixed,
> i.e. the namespace must be bound to a prefix and then these elements
> can be matched. So the news.xsl has to be something like the following:
> 
>>><xsl:stylesheet version="1.0"
>>>     xmlns="http://www.sevencs.com"
>>>     xmlns:s="http://www.sevencs.com"
>>>     xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>>>
>>>...
>>>
>>>   <xsl:template match="s:file">
>>>     <xsl:text>following file was added:</xsl:text>
>>>     <xsl:value-of select="./@path"/>
>>>   </xsl:template>
>>>
>>></xsl:stylesheet>
>>>
>>>It's an XSLT FAQ and more about it can be found here:
>>>http://www.dpawson.co.uk/xsl/sect2/N5536.html#d5360e970.
>>>
>>>Joerg


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


Mime
View raw message