[xslt] xlstproc from Ant - can't create directories using -o?



I've started using xsltproc to process a series of documents that contain
xinclude references to external lookup tables.  Because there are literally
hundreds of documents in many different directories, I've created an Ant
buildfile that discovers xml resources within a directory hierarchy and
submits each to xsltproc with the intention of constructing a translations
directory that contains a mirror of the original templates.  This works well
*as long as the translations directory structure exists* prior to calling
xsltproc.

To demonstrate, the example below succeeds provided the
'translations/xml/category1" directory exists.  If only the
'translations/xml' directory exists, xsltproc appears to successfully
process the file but no output file is ever generated.  In addition there
don't seem to be any error messages to indicate that the output file isn't
created, even when the -v and --debug flags are applied.

I'm sure I can have Ant reconstruct the directory structure prior to calling
xsltproc, but is that really necessary?  A quick review of the code shows a
XSLT_SECPREF_CREATE_DIRECTORY flag in the security code which suggests dir
creation is supported.  Am I doing something wrong or is there some good
reason for this behavior?

#----------------------------------
# sample invocation from templates directory
xsltproc --xinclude -o ../translations/xml/category1/instance1.xml
xsl/stylesheet1.xsl xml/category1/instance1.xml

#----------------------------------
# use an ant task to discover and
# process files in the templates
# directory and place translations
# in the generated directory
templates
  xml
    category1
      instance1.xml
      instance2.xml
    category2
      instance1.xml
      instance2.xml
    lookup
      table1.xml
      table2.xml
 xsd
   schema1.xsd
   schema2.xsd
 xsl
   stylesheet1.xsl
   stylesheet2.xsl

translations
  xml
    <duplicate templates structure>

#----------------------------------
# fyi - xsltproc on cygwin / win xp pro
$ xsltproc -version
Using libxml 20423, libxslt 10013 and libexslt 705
xsltproc was compiled against libxml 20417, libxslt 10013 and libexslt 705
libxslt 10013 was compiled against libxml 20417
libexslt 705 was compiled against libxml 20417





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]