cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ard Schrijvers" <a.schrijv...@hippo.nl>
Subject RE: Using the directory generator
Date Mon, 12 Dec 2005 22:22:48 GMT
Seems to be a namespace problem you have, though I don't see directly what you are doing wrong.

 
You can very easily debug it yourself by first doing someting like:
 
<xsl:value-of select="count(//child::node())"/>

or

<xsl:value-of select="count(child::node())"/>

and so on. Then probably you get some value > 0

Then try <xsl:value-of select="count(//dir:director/child:node())"/>

if now, your result is 0, you have a namespace problem. if not, try 

 <xsl:value-of select="count(dir:director/child:node())"/>
 
and so on. If you don't manage, mail me your output and xsl and I will solve it for you,
 
Good luck
 
AS
 
 
 -----Original Message-----
From: s9600916@inf.tu-dresden.de [mailto:s9600916@inf.tu-dresden.de]
Posted At: maandag 12 december 2005 17:22
Posted To: Cocoon User List
Conversation: Using the directory generator
Subject: Using the directory generator



Hi,

i wanted to use the xpath directory generator.

My pipeline is the following:

    <map:pipeline>
            <map:match pattern="dir-test">
                <map:generate type="xpathdirectory" src="../resources/data">
                    <map:parameter name="xmlFiles" value="\.xml$"/>
                </map:generate>
                <map:transform src="styles/directory2content.xsl"/>
                <map:serialize type="xml"/>
            </map:match>
        </map:pipeline>

After the genrator i receive the following data, which is exactly what i expected:

<dir:directory name="data" lastModified="1134380175000" date="12/12/05 10:36 AM" size="4096"
sort="name" reverse="false" requested="true">
    <dir:directory name="CVS" lastModified="1134380175000" date="12/12/05 10:36 AM" size="4096"/>
    <dir:file name="data.xsd" lastModified="1131651460000" date="11/10/05 8:37 PM" size="39967"/>
    <dir:file name="data.xml" lastModified="1131651460000" date="11/10/05 8:37 PM" size="45002"/>
</dir:directory>

Then i want to transform it with the following stylesheet:

<xsl:stylesheet version="1.0" xmlns:xsl= "http://www.w3.org/1999/XSL/Transform" <http://www.w3.org/1999/XSL/Transform>

    xmlns:sql= "http://apache.org/cocoon/SQL/2.0" <http://apache.org/cocoon/SQL/2.0>

    xmlns:dir= "http://apache.org/cocoon/directory/2.0." <http://apache.org/cocoon/directory/2.0.>
>
    
    <xsl:template match="/">
        <content>
            <heading>text</heading>
            <xsl:variable name="count" select="count(dir:directory/dir:file)"/>
            <message>
                <line>
                    <xsl:value-of select="$count"/>
                </line>
            </message>
            <table>
                <tableheader>
                    <tablecell>Name</tablecell>
                    <tablecell>Version</tablecell>
                </tableheader>
                <xsl:for-each select="dir:directory/dir:file">
                    <tablerow>
                        <tablecell>
                            <xsl:value-of select="@name"/>
                        </tablecell>
                        <tablecell>
                            <xsl:value-of select="@date"/>
                        </tablecell>
                    </tablerow>
                </xsl:for-each>
            </table>
        </content>
    </xsl:template>
</xsl:stylesheet>

I thought i did everything as it should be, but i always get just the following result:

<content>
    <heading>text</heading>
    <message>
        <line>
                  0
        </line>
    </message>
    <table>
        <tableheader>
            <tablecell>Name</tablecell>
            <tablecell>Version</tablecell>
        </tableheader>
    </table>
</content>


Does anyone know recognize my fault?

Thanks,
Tino



Mime
View raw message