bmargulies
bmargulies

Reputation: 100153

s9api versus trax with saxon-b

I was handed a shell script containing both:

java -cp $(CLASSPATH) net.sf.saxon.Transform -xsl:$(CMS_ROOT)/$(TRANSFORMS_DIR)/$(LOCALE_STYLESHEET) \ -it:root

and other cases that an output.

It wasn't obvious to me how to specify the initial transform through trax, so I went with the s9api.

Come to discover that passing a Serializer based on an output file to an XmlTransformer does not result in setting the base output URI to that file. I had to add:

transformer.getUnderlyingController().setBaseOutputURI(outputFile.toURI().toString());

All this suggests to me that I might be better off just talking to trax and figuring out how to specify an initial transform and anything else I need. Can anyone shed light one way or the other?

Upvotes: 0

Views: 223

Answers (1)

Michael Kay
Michael Kay

Reputation: 163468

Saxon 9.2 and later have a setBaseOutputURI() method on the s9api XsltTransformer class.

For 9.4 I will make the change you suggest, of using the destination URI of the Serializer as a default for the output base URI when possible.

Upvotes: 1

Related Questions