Menu

Multiple output from transform method

Help
Anonymous
2001-12-07
2012-10-08
  • Anonymous

    Anonymous - 2001-12-07

    I'm using the saxon transform() method to transform my xml. I'm would like the transformer to return multiple output. THe reason for doing this is that if the transformation fails on an xml element, then I want to copy this xml element to a different file - meaning I want to generate two files - one with all the good transformations and the second with all the xml elements that couldn't be transformed because there data was incorrect.

    I know that in your stylesheet you can generate multiple output but I don't know if I can do this through the transform() method.

    Sabrina

     
    • Michael Kay

      Michael Kay - 2002-01-29

      I think I replied off-list, but for the record: you can produce multiple output files when using the Java API (and the transform() method), but the output files are written relative to the current working directory, so you need to set this carefully. At present there's no equivalent of the URIResolver for secondary output files, so you can't catch the result trees directly, they have to be serialized to disk files.

      Mike Kay