cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stuart Roebuck>
Subject XSP Tag Libraries - yes..again!
Date Fri, 07 Apr 2000 19:11:05 GMT
I know - this has come up before (but before you beat me up...I have read  
all the previous postings in the archive) it's just that I'm still stuck!

I have the following bit of 'direct' xsp code which searches for ".xml"  
files in a subdirectory and then includes <include  
ref="subdirectory/filename.xml"></include> tags in the document before  
passing it on through the xslt stage (and the "page.xsl" stylesheet) and  
turning them into <apply-templates  
select="document(subdirectory/filename.xml)"/> tags.

The net result is that I include all the xml files in the subdirectory on  
the fly.

(By the way - if there's a more straightforward way of doing this please  
tell me!)


Having got this up and running I want to turn it into an xsp tag library  
so that I can use it as a single tag without having to worry about the java  
code.  But whenever I do it I seem to have problems.

Whilst we wait for better documentation (...yes I hate doing it to...)  
would any kind sole suggest how I might tag this following code...

<?xml version="1.0"?>
<?cocoon-process type="xsp"?>
<?xml-stylesheet href="page.xsl" type="text/xsl"?>
<?cocoon-process type="xslt"?>

<xsp:page language="java" xmlns:xsp="">


        String subDir = "pages";
        File theFile =
             new File(new File(request.getPathTranslated()).getParent() +
                 "/" + subDir);
        String files[] = theFile.list(new FilenameFilter() {
            public boolean accept(File file, String name) {
               return (name.endsWith(".xml"));
        for (int i = 0; i < files.length; i++) { ]]>
          <xsp:attribute name="ref"><xsp:expr>files[i]</xsp:expr></xsp:attribute>




(By the way - this works great on MacOS X)

View raw message