[ 
https://issues.apache.org/jira/browse/XERCESJ-1752?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17636302#comment-17636302
 ] 

Mukul Gandhi commented on XERCESJ-1752:
---------------------------------------

I can reproduce the issue, pointed by you.

When I use, for example jdk 1.8.0_281, with the XML and XSD document samples 
that you've provided, XercesJ 2.12.2's XML Schema 1.1 validator produces 
following error messages,

at javax.xml.validation.Validator.validate(Unknown Source)
        at jaxp.SourceValidator.validate(Unknown Source)
        at jaxp.SourceValidator.main(Unknown Source)
Caused by: java.lang.IllegalArgumentException: Invalid version number: Version 
number may be negative or greater than 255
        at com.ibm.icu.util.VersionInfo.getInstance(VersionInfo.java:197)
        at com.ibm.icu.impl.ICUDebug.getInstanceLenient(ICUDebug.java:65)
        at com.ibm.icu.impl.ICUDebug.<clinit>(ICUDebug.java:69)

This is a bug with ICU library, that's bundled with XercesJ 2.12.2.

According to the page https://www.ibm.com/support/pages/apar/PH33831, this was 
first fixed within ICU library version 68.1. When I use the ICU library jar 
68.1, instead of what's bundled with XercesJ 2.12.2, this issue gets resolved.

I think that, if we use jdk 1.8 versions like 1.8.0_<n> where n is <= 255 
(that's what I think, above mentioned error messages mean), XercesJ 2.12.2 
shall work fine (for your example) with the ICU jar that's bundled with it.

I think, we should bundle ICU jar 68.1 with the next XercesJ release, that'll 
resolve this issue for users, and upgrade the XercesJ distribution to Java 1.8 
(since ICU jar 68.1 is built with Java 1.8).

I think that, using the latest Eclipse XPath 2.0 jar, available on Eclipse is 
not the correct resolution for this issue. Since its APIs are little bit, 
incompatible with what XercesJ needs, and I think the XPath 2.0 jar that's 
currently bundled with XercesJ has other fixes as well.

Also IMHO, moving on to ICU jar v 68.1, XercesJ's XML Schema 1.1 validator and 
the XPath 2.0 engine that's bundled with it, need to pass the XML Schema test 
suite that we've.

> 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
>            Priority: Major
>         Attachments: Test.xml, Test.xsd
>
>
> 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 it takes an array of objects,  it seems that they accept a sequence of 
> nodes 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-unsubscr...@xerces.apache.org
For additional commands, e-mail: j-dev-h...@xerces.apache.org

Reply via email to