css4j / echosvg

SVG implementation in the Java™ Language, fork of Apache Batik, supporting level 4 selectors and colors.
Apache License 2.0
39 stars 2 forks source link

Deprecate `XMLReader` variant of `DocumentFactory.createDocument`, add `setXMLReader` #71

Closed carlosame closed 1 year ago

carlosame commented 1 year ago

Interface DocumentFactory in the dom module has the following method variant:

https://github.com/css4j/echosvg/blob/a42e24dcf08508ff78955ef3e35ff9871dfb95f6/echosvg-dom/src/main/java/io/sf/carte/echosvg/dom/util/DocumentFactory.java#L80

which is confusing because only allows the usage of the XMLReader via the document URI retrieval.

That method should be deprecated, and instead a new setXMLReader(XMLReader) could be added. That way, one can specify an XMLReader to be used by the factory, regardless of the chosen input variant (stream, reader or URI retrieval).