Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-14155

xpath throws NPE if body is null when saxon is used as JAXP implementation

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0.0
    • Component/s: came-core
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      despite XPath API spec states:

       

      If a null value is provided for item, an empty document will be used for the context

      saxon, starting from 9.6, they decided to ignore it and throw NPE if the node is null, from saxon javadoc:

       

      Contrary to the interface specification, Saxon does not supply an empty document when the value is null. This is because XPath 2.0 allows the context item to be "absent" (null). So Saxon executes the XPath expression with the context item undefined.

       

       So in case of xpath expression is executed against a null body or header, saxon throws an NPE

       

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ldemasi Luigi De Masi
                Reporter:
                ldemasi Luigi De Masi
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m