setOutputProperty(), setParameter() and setURIResolver() methods of javax.xml.transform.Transformer

410 views Asked by At

What is the use of the methods setOutputProperty(), setParameter() and setURIResolver() of the class javax.xml.transform.Transformer? I had went through the official documentation and many other online resources, but I was unable to understand it clearly.

1

There are 1 answers

0
David P. Caldwell On

It's not obvious from the documentation because they don't link it prominently (but subtly), but setOutputProperty refers to OutputKeys, and those values can be used for the property names (and contain information about what they do, like control the indentation of the output).

setParameter makes a parameter value available to the transform; see XSL Transformation in Java with parameters.

setURIResolver allows the caller to specify how to find URIs. This might, for example, be used to load public identifiers like -//OASIS//DTD DocBook XML//EN; see Formal Public Identifier, or to load network resources from a local filesystem or database.