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.
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.