[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Java list extension
Dear List,
I'm within some serious project boundrys so I'm left with one and only option: copying files with XSLT. Now I solved that a while ago (with help of this list), like: <xsl:value-of select="java-fc:transferTo($FileChannelIn, 0, $size, $FileChannelOut), java-fc:close($FileChannelIn), java-fc:close($FileChannelOut)"/> Now I need a way to discover the contents of a directory (files and other directorys). So far I have: <xsl:variable name="directory" select="java-file:new($sourcefileURI)"/> <xsl:variable name="tst"> <!-- as="class:java.io.File" --> <xsl:value-of select="for $file in java-file:list($directory) return concat($sourcefileURI,$file)"/> </xsl:variable> (xmlns:java-file="java.io.File") This works when I put $tst to output: <xsl:variable name="fftest" select="tokenize($tst,' ')"/> <xsl:for-each select="$fftest"> Problem is that I converted it to a ordinary string and i do need the collection because I want to find out if a entry is a directory or not, like: <xsl:value-of select="java-file:isDirectory($....)"/> Questions: How do I type the $tst var so it behaves like a Java collection and I can use it like a Java File collection. What I want is something like: <xsl:variable name="dirContents"> <!-- as="class:java.io.File" ??? --> <xsl:value-of select="for $file in java-file:list($directory) return concat($sourcefileURI,$file)"/> </xsl:variable> <xsl:for-each select=$dirContents> <xsl:choose> <xsl:when test=java-file:isDirectory(.)> do this </xsl:when> <xsl:otherwise> just copy the file </xsl:otherwise> </xsl:choose> </xsl:for-each> Thanks. Regards, Geurt Lagemaat
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|