You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by "Ivan Pedruzzi (Jira)" <xe...@xml.apache.org> on 2022/11/20 06:15:00 UTC

[jira] [Created] (XERCESJ-1752) Cannot use latest IBM ICU with latest Xerces, need support for the latest Eclipse XPath Engine

Ivan Pedruzzi created XERCESJ-1752:
--------------------------------------

             Summary: Cannot use latest IBM ICU with latest Xerces, need support for the latest Eclipse XPath Engine
                 Key: XERCESJ-1752
                 URL: https://issues.apache.org/jira/browse/XERCESJ-1752
             Project: Xerces2-J
          Issue Type: Improvement
            Reporter: Ivan Pedruzzi


The latest ICU 72  [https://github.com/unicode-org/icu/releases/download/release-72-1/icu4j-72_1.jar]

breaks the Eclipse XPath engine 1.2.1 bundled with Xerces.

     the ICU lib removed function isHighSurrogate from class UCharacter which is used by the constructor of class StringCodePointIterator

  Exception in thread "main" java.lang.NoSuchMethodError: com.ibm.icu.lang.UCharacter.isHighSurrogate(C)Z

      at org.eclipse.wst.xml.xpath2.processor.internal.utils.StringCodePointIterator.<init>(StringCodePointIterator.java:35)

to fix the problem, you may think to update to the latest Eclipse XPath engine 2.1 [https://www.jabylon.org/maven/org/eclipse/wst/xml/xpath2/processor/2.1.100/processor-2.1.100.jar]

but that breaks Xerces 2.1 

because Eclipse XPath removed the constructor of class DefaultEvaluator used by AbstractXPath2EngineImpl.evaluateXPathExpr

 

Exception in thread "main" java.lang.NoSuchMethodError: org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator.<init>(Lorg/eclipse/wst/xml/xpath2/processor/DynamicContext;Lorg/w3c/dom/Document;Lorg/w3c/dom/Node;)V

      at org.apache.xerces.impl.xs.AbstractXPath2EngineImpl.evaluateXPathExpr(Unknown Source)

 

Looking at the new constructor rather than taking a single org.w3c.dom.Node, now takes an array of Objects,  it seems that they accept a sequence of items as context

 

public DefaultEvaluator(

org.eclipse.wst.xml.xpath2.api.StaticContext staticContext,

org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext,

Object[] contextItems) {

 

       this(staticContext, dynamicContext);

 

       // initialize context item with root of document

       ResultBuffer rs = new ResultBuffer();

       for (Object obj : contextItems) {

              if (obj instanceof Node) rs.add(NodeType.dom_to_xpath((Node)obj, _sc.getTypeModel()));

       }

       set_focus(new Focus(rs.getSequence()));

       _param = null;

}

 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org