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 Mukul Gandhi <mu...@apache.org> on 2014/02/01 02:41:10 UTC

Re: [jira] [Commented] (XERCESJ-1623) Invalid characters in assertion XPath expression

The current XPath library on xerces SVN is fully compliant to W3C XPath 2.0
spec. I agree that, newer XPath 2.0 library on Eclipse SE project is better
in terms of API support for consuming applications. I think,new psychopath
XPath 2.0 APIs is not critical requirements for us just now. Non xerces
adopters of psychopath XPath engine would be better adopters of newer
psychopath XPath 2.0 APIs.

Regards,
Mukul
On Jan 31, 2014 8:12 PM, "Radu Coravu" <ra...@sync.ro> wrote:

> Hi,
>
> About this remark:
>
>  After which we've to test against W3C XSD 1.1 test suite, and perhaps
>> also against a tiny Xerces XSD 1.1 unit test suite.
>>
>
> I thought you had automated tests for this. It seems to me that it's more
> damaging to use an older library which does not properly cover the XPath
> specification completely then to update to a new version.
>
> Regards,
> Radu
>
> Radu Coravu
> <oXygen/>  XML Editor, Schema Editor and XSLT Editor/Debugger
> http://www.oxygenxml.com
>
> On 1/31/2014 3:14 AM, Mukul Gandhi wrote:
>
>> I'm moving this discussion, to Xerces devs forum. I've analyzed this
>> issue a bit, and following are what I think currently,
>>
>> Moving to the new psychopath XPath 2.0 jar file as has been posted in
>> the jira issue, would require changes to Xerces's source code at various
>> places. After which we've to test against W3C XSD 1.1 test suite, and
>> perhaps also against a tiny Xerces XSD 1.1 unit test suite. This seems
>> to be lot of work.
>>
>> There's another idea I've currently. We can modify Xerces's source code,
>> to simultaneously be able to use both an earlier jar file (currently on
>> SVN) and the new one posted in the current jira thread (or something
>> like this, therefore the current compilation of Xerces XSD 1.1 doesn't
>> invalidate). I think, this would be good modularity and would serve us
>> well in the long run.
>>
>> Doing all of this, is significant work I think. I'm not in a position to
>> make such changes to Xerces's source code currently :(
>>
>> But overall, I support the idea suggested in this jira issue.
>>
>>
>> On Tue, Jan 28, 2014 at 12:13 PM, Radu Coravu (JIRA)
>> <xerces-j-dev@xml.apache.org <ma...@xml.apache.org>> wrote:
>>
>>
>>          [
>>     https://issues.apache.org/jira/browse/XERCESJ-1623?page=
>> com.atlassian.jira.plugin.system.issuetabpanels:comment-
>> tabpanel&focusedCommentId=13883817#comment-13883817
>>     ]
>>
>>     Radu Coravu commented on XERCESJ-1623:
>>     --------------------------------------
>>
>>     I went here:
>>
>>     http://download.eclipse.org/webtools/downloads/
>>
>>     clicked the "3.5.1" link to the Web Tools Platform Project and in
>>     the other page I went to the "Traditional Zip Files" section and
>>     downloaded a large ZIP archive which also contains the
>>     "org.eclipse.wst.xml.xpath2.processor_*.jar" JAR.
>>
>>      > Invalid characters in assertion XPath expression
>>      > ------------------------------------------------
>>      >
>>      >                 Key: XERCESJ-1623
>>      >                 URL:
>>     https://issues.apache.org/jira/browse/XERCESJ-1623
>>      >             Project: Xerces2-J
>>      >          Issue Type: Bug
>>      >          Components: XML Schema 1.1 Structures
>>      >    Affects Versions: 2.11.0
>>      >            Reporter: Octavian Nadolu
>>      >         Attachments:
>>     org.eclipse.wst.xml.xpath2.processor_2.1.2.v201212060048.jar
>>      >
>>      >
>>      > If I validate the following XML Schema, I get an error:
>>      > "cvc-xpath.3.13.4.2a: XPST0003 - Assertion XPath expression
>>     ('count(le:Einführung) le 1') on the schema type 'defKapitel'
>>     couldn't compile successfully."
>>      > I tested on the xml-schema-1.1-dev branch.
>>      > The error occurs because of the "ü" character that is used in the
>>     assertion. The problem seems to be the in the PsychoPath library
>>     (org.eclipse.wst.xml.xpath2.processor_1.2.0.jar) that Xerces uses.
>>      > I updated the PsychoPath library to the latest version, 2.1.2,
>>     and the validation seems to work well.
>>      > In order to make Xerces work with the new PsychoPath library, you
>>     need to make two modifications:
>>      > -  in XSAssertionXPath2ValueImpl.java, you need to use
>>     PsychoPathTypeHelper instead of PsychoPathXPathTypeHelper.
>>      > - in AbstractPsychoPathXPath2Impl, the constructors of
>>     DefaultEvaluator and ElementType are modified.
>>      > ------ XML Schema --------------------
>>      > <?xml version="1.0" encoding="UTF-8"?>
>>      > <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
>>     elementFormDefault="qualified"
>>      >     xmlns:le="myns" targetNamespace="myns"
>>      >     xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning"
>>     vc:minVersion="1.1">
>>      >     <xs:element name="Einführung"/>
>>      >     <xs:element name="Lernziele"/>
>>      >     <xs:element name="Textebene-1"/>
>>      >     <xs:complexType name="defKapitel">
>>      >         <xs:sequence>
>>      >             <xs:choice minOccurs="0" maxOccurs="2">
>>      >                 <xs:element ref="le:Einführung"/>
>>      >                 <xs:element ref="le:Lernziele"/>
>>      >             </xs:choice>
>>      >             <xs:element minOccurs="1" maxOccurs="unbounded"
>>     ref="le:Textebene-1"/>
>>      >         </xs:sequence>
>>      >         <xs:assert test="count(le:Einführung) le 1"/>
>>      >     </xs:complexType>
>>      > </xs:schema>
>>      > --------------------------------------------
>>
>>
>>
>>     --
>>     This message was sent by Atlassian JIRA
>>     (v6.1.5#6160)
>>
>>
>>
>>
>> Regards,
>> Mukul Gandhi
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
> For additional commands, e-mail: j-dev-help@xerces.apache.org
>
>

Re: [jira] [Commented] (XERCESJ-1623) Invalid characters in assertion XPath expression

Posted by Mukul Gandhi <mu...@apache.org>.
Hi Radu,
   Please see my comments inline,

On Mon, Feb 3, 2014 at 6:58 PM, Radu Coravu <ra...@sync.ro> wrote:

>
>  The current XPath library on xerces SVN is fully compliant to W3C XPath
>> 2.0 spec.
>>
>
> The XPath 2.0 specification states that an XPath QName:
>
>  http://www.w3.org/TR/xpath20/#prod-xpath-QName
>>
>
> has a prefix and a local part which is of type NCName:
>
>  http://www.w3.org/TR/REC-xml-names/#NT-NCName
>>
>
> and the NCName needs to be composed of characters which obey the
> specification:
>
>  http://www.w3.org/TR/REC-xml/#NT-Char
>>
>
> If the XPath parser included with the Xerces XML Schema 1.1 would be fully
> compliant with the XPath 2.0 specs, it would be able to accept as valid
> most of the unicode characters when used in NCNames


I agree with you. I think, Xerces's XSD 1.1 engine currently supports an
ASCII like character set for XML names and values of attributes. It
probably supports certain unicode characters for XML names, but I'm not
sure which ones (we need to check the implementation details again, within
psychopath xpath 2.0 engine).

but it has trouble even with simple characters like "ü" and it breaks when
> validating assertions like:
>
>
>  <xs:assert test="count(le:Einführung) le 1"/>
>>
>
I agree, an XPath 2.0 processor needs to support most of unicode
characters. Implementing XPath 2.0 spec is quite overwhelming. But I think,
Xerces has done a very good job, of implementing (actually, starting from
adopting the original psychopath xpath 2.0 engine and then improving it)
nearly every functional aspect of XPath 2.0.


>
> So in my opinion the XPath library currently bundled with Xerces is not
> fully compliant to the W3C XPath 2.0 spec.


I agree, its technically true. But we're very close to a near compliance,
except for a wider unicode support as you've pointed. I'm not a personal
expert on unicode implementation, but I find this area interesting. May be
someone else can take this task in near term, for improving Xerces's XPath
2.0 unicode support.

As has been discussed few times, on this forum why we can't quickly adopt
the current Eclipse psychopath XPath 2.0 engine. Mainly because, of JDK
level mismatches and also difference in spec functional compliance of XPath
2.0 engine on Xerces SVN and on Eclipse SE project. I think, there are few
areas (like few F&O implementations) where XPath 2.0 engine on Xerces SVN
complies better to the XPath 2.0 spec (that's my personal opinion).


Regards,
Mukul

Re: [jira] [Commented] (XERCESJ-1623) Invalid characters in assertion XPath expression

Posted by Radu Coravu <ra...@sync.ro>.
Hi Mukul,

You mention:

> The current XPath library on xerces SVN is fully compliant to W3C XPath 2.0 spec.

The XPath 2.0 specification states that an XPath QName:

> http://www.w3.org/TR/xpath20/#prod-xpath-QName

has a prefix and a local part which is of type NCName:

> http://www.w3.org/TR/REC-xml-names/#NT-NCName

and the NCName needs to be composed of characters which obey the 
specification:

> http://www.w3.org/TR/REC-xml/#NT-Char

If the XPath parser included with the Xerces XML Schema 1.1 would be 
fully compliant with the XPath 2.0 specs, it would be able to accept as 
valid most of the unicode characters when used in NCNames, but it has 
trouble even with simple characters like "ü" and it breaks when 
validating assertions like:

> <xs:assert test="count(le:Einführung) le 1"/>

So in my opinion the XPath library currently bundled with Xerces is not 
fully compliant to the W3C XPath 2.0 spec. And if it will not be 
updated, the Xerces XML Schema 1.1 validation will never be 100% 
compliant with the XML Schema 1.1 specification.

Regards,
Radu

Radu Coravu
<oXygen/>  XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

On 2/1/2014 3:41 AM, Mukul Gandhi wrote:
> The current XPath library on xerces SVN is fully compliant to W3C XPath
> 2.0 spec. I agree that, newer XPath 2.0 library on Eclipse SE project is
> better in terms of API support for consuming applications. I think,new
> psychopath XPath 2.0 APIs is not critical requirements for us just now.
> Non xerces adopters of psychopath XPath engine would be better adopters
> of newer psychopath XPath 2.0 APIs.
>
> Regards,
> Mukul
>
> On Jan 31, 2014 8:12 PM, "Radu Coravu" <radu_coravu@sync.ro
> <ma...@sync.ro>> wrote:
>
>     Hi,
>
>     About this remark:
>
>         After which we've to test against W3C XSD 1.1 test suite, and
>         perhaps also against a tiny Xerces XSD 1.1 unit test suite.
>
>
>     I thought you had automated tests for this. It seems to me that it's
>     more damaging to use an older library which does not properly cover
>     the XPath specification completely then to update to a new version.
>
>     Regards,
>     Radu
>
>     Radu Coravu
>     <oXygen/>  XML Editor, Schema Editor and XSLT Editor/Debugger
>     http://www.oxygenxml.com
>
>     On 1/31/2014 3:14 AM, Mukul Gandhi wrote:
>
>         I'm moving this discussion, to Xerces devs forum. I've analyzed this
>         issue a bit, and following are what I think currently,
>
>         Moving to the new psychopath XPath 2.0 jar file as has been
>         posted in
>         the jira issue, would require changes to Xerces's source code at
>         various
>         places. After which we've to test against W3C XSD 1.1 test
>         suite, and
>         perhaps also against a tiny Xerces XSD 1.1 unit test suite. This
>         seems
>         to be lot of work.
>
>         There's another idea I've currently. We can modify Xerces's
>         source code,
>         to simultaneously be able to use both an earlier jar file
>         (currently on
>         SVN) and the new one posted in the current jira thread (or something
>         like this, therefore the current compilation of Xerces XSD 1.1
>         doesn't
>         invalidate). I think, this would be good modularity and would
>         serve us
>         well in the long run.
>
>         Doing all of this, is significant work I think. I'm not in a
>         position to
>         make such changes to Xerces's source code currently :(
>
>         But overall, I support the idea suggested in this jira issue.
>
>
>         On Tue, Jan 28, 2014 at 12:13 PM, Radu Coravu (JIRA)
>         <xerces-j-dev@xml.apache.org
>         <ma...@xml.apache.org>
>         <mailto:xerces-j-dev@xml.__apache.org
>         <ma...@xml.apache.org>>> wrote:
>
>
>                   [
>         https://issues.apache.org/__jira/browse/XERCESJ-1623?page=__com.atlassian.jira.plugin.__system.issuetabpanels:comment-__tabpanel&focusedCommentId=__13883817#comment-13883817
>         <https://issues.apache.org/jira/browse/XERCESJ-1623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13883817#comment-13883817>
>              ]
>
>              Radu Coravu commented on XERCESJ-1623:
>              ------------------------------__--------
>
>              I went here:
>
>         http://download.eclipse.org/__webtools/downloads/
>         <http://download.eclipse.org/webtools/downloads/>
>
>              clicked the "3.5.1" link to the Web Tools Platform Project
>         and in
>              the other page I went to the "Traditional Zip Files"
>         section and
>              downloaded a large ZIP archive which also contains the
>              "org.eclipse.wst.xml.xpath2.__processor_*.jar" JAR.
>
>               > Invalid characters in assertion XPath expression
>               > ------------------------------__------------------
>               >
>               >                 Key: XERCESJ-1623
>               >                 URL:
>         https://issues.apache.org/__jira/browse/XERCESJ-1623
>         <https://issues.apache.org/jira/browse/XERCESJ-1623>
>               >             Project: Xerces2-J
>               >          Issue Type: Bug
>               >          Components: XML Schema 1.1 Structures
>               >    Affects Versions: 2.11.0
>               >            Reporter: Octavian Nadolu
>               >         Attachments:
>
>         org.eclipse.wst.xml.xpath2.__processor_2.1.2.v201212060048.__jar
>               >
>               >
>               > If I validate the following XML Schema, I get an error:
>               > "cvc-xpath.3.13.4.2a: XPST0003 - Assertion XPath expression
>              ('count(le:Einführung) le 1') on the schema type 'defKapitel'
>              couldn't compile successfully."
>               > I tested on the xml-schema-1.1-dev branch.
>               > The error occurs because of the "ü" character that is
>         used in the
>              assertion. The problem seems to be the in the PsychoPath
>         library
>              (org.eclipse.wst.xml.xpath2.__processor_1.2.0.jar) that
>         Xerces uses.
>               > I updated the PsychoPath library to the latest version,
>         2.1.2,
>              and the validation seems to work well.
>               > In order to make Xerces work with the new PsychoPath
>         library, you
>              need to make two modifications:
>               > -  in XSAssertionXPath2ValueImpl.__java, you need to use
>              PsychoPathTypeHelper instead of PsychoPathXPathTypeHelper.
>               > - in AbstractPsychoPathXPath2Impl, the constructors of
>              DefaultEvaluator and ElementType are modified.
>               > ------ XML Schema --------------------
>               > <?xml version="1.0" encoding="UTF-8"?>
>               > <xs:schema xmlns:xs="http://www.w3.org/__2001/XMLSchema
>         <http://www.w3.org/2001/XMLSchema>"
>              elementFormDefault="qualified"
>               >     xmlns:le="myns" targetNamespace="myns"
>               >
>         xmlns:vc="http://www.w3.org/__2007/XMLSchema-versioning
>         <http://www.w3.org/2007/XMLSchema-versioning>"
>              vc:minVersion="1.1">
>               >     <xs:element name="Einführung"/>
>               >     <xs:element name="Lernziele"/>
>               >     <xs:element name="Textebene-1"/>
>               >     <xs:complexType name="defKapitel">
>               >         <xs:sequence>
>               >             <xs:choice minOccurs="0" maxOccurs="2">
>               >                 <xs:element ref="le:Einführung"/>
>               >                 <xs:element ref="le:Lernziele"/>
>               >             </xs:choice>
>               >             <xs:element minOccurs="1" maxOccurs="unbounded"
>              ref="le:Textebene-1"/>
>               >         </xs:sequence>
>               >         <xs:assert test="count(le:Einführung) le 1"/>
>               >     </xs:complexType>
>               > </xs:schema>
>               > ------------------------------__--------------
>
>
>
>              --
>              This message was sent by Atlassian JIRA
>              (v6.1.5#6160)
>
>
>
>
>         Regards,
>         Mukul Gandhi
>
>
>
>     ------------------------------__------------------------------__---------
>     To unsubscribe, e-mail: j-dev-unsubscribe@xerces.__apache.org
>     <ma...@xerces.apache.org>
>     For additional commands, e-mail: j-dev-help@xerces.apache.org
>     <ma...@xerces.apache.org>
>



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