You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Mikael Petterson <mi...@ericsson.com.INVALID> on 2023/04/25 13:56:05 UTC
Difference when setting xml reader and not
Hi,
We use
Method 1:
XmlOptions options = new XmlOptions();
options.setLoadUseXMLReader(SAXParserFactory.newInstance().newSAXParser().getXMLReader());
XmlObject.Factory.parse(str, options);
As well as
Method 2:
XmlObject.Factory.parse(str);
We changed from jdom 1.1.3 to jdom2 and it seems that method 1 is picking up the change and gets affected but not method 2.
Which parser is then used for method 2?
Br,
//mike
Re: Difference when setting xml reader and not
Posted by PJ Fanning <fa...@yahoo.com.INVALID>.
If you use the method that does not take an explicit options instance, then default behaviour will happen. If you want non-default behaviour, you must always use `XmlObject.Factory.parse(str, options);`.
I would think that most users would expect this to be the behaviour.
On Tuesday 25 April 2023 at 15:57:38 GMT+2, Mikael Petterson <mi...@ericsson.com.invalid> wrote:
Hi,
We use
Method 1:
XmlOptions options = new XmlOptions();
options.setLoadUseXMLReader(SAXParserFactory.newInstance().newSAXParser().getXMLReader());
XmlObject.Factory.parse(str, options);
As well as
Method 2:
XmlObject.Factory.parse(str);
We changed from jdom 1.1.3 to jdom2 and it seems that method 1 is picking up the change and gets affected but not method 2.
Which parser is then used for method 2?
Br,
//mike
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org