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

> Can you log this in bugzilla so I don't loose track of the issue.

Absolutely.  Bugzilla's misbehaving at the moment ... will try again in the

> Adding a call to xsltCheckWrite() in xsltproc before calling
> xsltSaveResultToFile() will probably be sufficient.

Yes, that works though I had to poke around a bit to discover where the save
is invoked.  I expected it to be called directly from xsltProcess() but when
the output variable is set there's a conditional that jumps past most of the
process code and calls xsltRunStylesheetUser ... which eventually calls
xsltSaveResultToFile().  There's probably a better way to do it, but the
following hack temporarily takes care of the problem.

447:      ctxt = xsltNewTransformContext(cur, doc);
448:      if (ctxt == NULL)
449:        return;
450:	    /* temporary hack to insure dirs get created */
451:	    xsltCheckWrite(ctxt->sec, ctxt, output);
452:	    /* end hack */
453:      if (profile) {
454:        ret = xsltRunStylesheetUser(cur, doc, params, output,
455:		   NULL, NULL, stderr, ctxt);
456:      } else {
457:        ret = xsltRunStylesheetUser(cur, doc, params, output,
458:		   NULL, NULL, NULL, ctxt);
459:      }



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