Project

Profile

Help

Incorrect number of output files

Added by Anonymous over 19 years ago

Legacy ID: #2996118 Legacy Poster: wattsferry (wattsferry)

Hi all, I'm having an odd problem with xsl:result-document, where it is seemingly outputting an incorrect number of files back to the filesystem. I've tested this on Linux, OS X, and Windows filesystems, and I get the same result. For my xml: http://libserv12.princeton.edu/ead/vra_access.xml I'm expecting 2407 records to be output. The amount I receive back is 2360. I've done many greps, XPath count()s,, and even used a Perl-based tool called xml_split and ended up with 2407 records for both the vra element and the //vra/recordSet/record/id[@type='currentRepository'] XPath upon which the files are named. Is there something wrong with my stylesheet that is causing the error? See: http://libserv12.princeton.edu/ead/breakUpXML.xsl Here's the contents of it: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:output indent="yes" method="xml" version="1.0" encoding="utf-8"/> <xsl:strip-space elements="*"/> <xsl:template match="/"> <xsl:apply-templates/> </xsl:template> <xsl:template match="wrapper"> <xsl:apply-templates/> </xsl:template> <xsl:template match="vra"> <xsl:param name="filename" select="./recordSet/record/id[@type='currentRepository']"/> <xsl:result-document href="file:///c:/docume~1/credding/desktop/vracor~1/wc064/{$filename}.xml"> <xsl:copy-of select="."/> </xsl:result-document> </xsl:template> </xsl:stylesheet> Thanks for any help, Clay


Replies (1)

RE: Incorrect number of output files - Added by Anonymous over 19 years ago

Legacy ID: #2996254 Legacy Poster: Michael Kay (mhkay)

Your source XML file appears to be rather large (it would have been nice to warn people of this!). Trying to load it into my browser caused havoc. Please try to reproduce the problem with a smaller file. If you're using the latest Saxon 8.3, attempts to output two files with the same name should give an error message; with earlier releases the second one will overwrite the first. So we need to know which version you are using. Have you tried count(distinct-values(...)) on the path expression that forms the filename? Have you tried replacing {$filename} in the file name with {generate-id()} - that would guarantee that the file names are unique. Michael Kay

    (1-1/1)

    Please register to reply