Claus Ibsen created CAMEL-27908:
-----------------------------------
Summary: camel-xslt: NullPointerException with an entityResolver
and a SAXSource body without an XMLReader, xpathTotalOpLimit default differs
from the docs
Key: CAMEL-27908
URL: https://issues.apache.org/jira/browse/CAMEL-27908
Project: Camel
Issue Type: Bug
Components: camel-xslt
Reporter: Claus Ibsen
Fix For: 4.25.0
Found while improving the option descriptions of camel-xslt for CAMEL-23832
(pull request https://github.com/apache/camel/pull/31166).
These are separate problems of the component; the descriptions change only
documents the current behavior.
h4. 1. NullPointerException with an entityResolver and a SAXSource without an
XMLReader
{{XsltBuilder.tryAddEntityResolver}} calls
source.getXMLReader().setEntityResolver(...) without a null check, so a
SAXSource body that has no XMLReader fails with a NullPointerException when an
entityResolver is set.
Proposed change: create a reader when it is null, or skip.
h4. 2. xpathTotalOpLimit default
The option is documented with default 10000, but the field defaults to 0, in
which case Camel sets nothing and the JDK setting applies (10000 in
jaxp.properties). On a Saxon factory setAttribute throws
IllegalArgumentException, which is caught, so the option does nothing for
xslt-saxon.
Proposed change: align the documented default with the code.
h4. 3. xsltMessageLogger has no effect on xslt
xsltMessageLogger is an endpoint option of xslt, but only XsltSaxonBuilder uses
it.
Proposed change: move it to xslt-saxon, or exclude it for xslt.
_Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)