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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
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