Any builder of a document root backing element. Typical document builders convert the document URI
to a local URI, parse the document using that local URI, and after parsing store the original
URI as document URI in the returned backing element.
Document builders can be stacked, for example to perform some "post-processing".
For example, some taxonomy document may have a broken link in the schema location attribute, and
such a post-processing step can fix that before the backing element is used to build a type-safe
taxonomy DOM tree from it.
Note that document builders backed by typical XML parsers are not thread-safe!
Note that these builders return root elements and not documents, so top-level comments and processing
instructions are lost. It should be possible to parse the document later again, given the document URI,
if needed using StAX in order to get only the top-level comments, processing instructions and XML
declaration. Retrieval of these information items can be hidden behind strategy interfaces, so only
"application wiring" needs to worry about how to obtain this data.
Any builder of a document root backing element. Typical document builders convert the document URI to a local URI, parse the document using that local URI, and after parsing store the original URI as document URI in the returned backing element.
Document builders can be stacked, for example to perform some "post-processing". For example, some taxonomy document may have a broken link in the schema location attribute, and such a post-processing step can fix that before the backing element is used to build a type-safe taxonomy DOM tree from it.
Note that document builders backed by typical XML parsers are not thread-safe!
Note that these builders return root elements and not documents, so top-level comments and processing instructions are lost. It should be possible to parse the document later again, given the document URI, if needed using StAX in order to get only the top-level comments, processing instructions and XML declaration. Retrieval of these information items can be hidden behind strategy interfaces, so only "application wiring" needs to worry about how to obtain this data.