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 JOHN Morris <j....@ntlworld.com.INVALID> on 2021/02/17 12:59:14 UTC

Re: [jira] [Comment Edited] (XERCESJ-1726) Possible Bug: Xerces 2.12.1 for XML Validation with XSD 1.1 Schema under Java

Hi Mukul,

Hope you are well.

Am I correct in thinking that no-one on the Xerces developer side has picked up my error report and is investigating it?

Is there anything that I can do to make that more likely to happen?

Failing that, the I guess that it's down to me to look into the Java code. My initial ideas on this were to use the Eclipse Development/Debug environment and attempt to set breakpoint(s) around the "unexpected" errror events. However, this requires source code for all (most) of the Java classes. In the way I was running the tests, I was using ".jar" files to provide the definition of most classes. It has so far proved impossible to insert a breakpoint into a class coming from a ".jar" file.

To work round this restriction, my idea was to utilize the source code either from the "Xerces with source" download or from the selected JDK version. I have used the jar executable to list the contents of the Xerces ".jar" files and I am busy trying to map namespaced class names to their source.

Once this mapping is complete, I plan to reference the relevant source files directly from Eclipse and then set the necessary breakpoints.

Potential snags are with ".jar" entries with no corresponding source fies (e.g. org.eclipse.wst.xml.xpath2.processor_1.2.0.jar).

Does this approach sound reasonable to you?

Many thanks,

John.


> On 06 September 2020 at 06:14 "Mukul Gandhi (Jira)" <xerces-j-dev@xml.apache.org mailto:xerces-j-dev@xml.apache.org > wrote:
> 
> 
> 
>     [ https://issues.apache.org/jira/browse/XERCESJ-1726?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17191197#comment-17191197 https://issues.apache.org/jira/browse/XERCESJ-1726?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17191197#comment-17191197 ]
> 
>     Mukul Gandhi edited comment on XERCESJ-1726 at 9/6/20, 5:13 AM:
>     ----------------------------------------------------------------
> 
>     I do feel that, John's test cases point to unexpected behavior with Xerces-J, and may be a possible bug.
> 
>     @John: Xerces-J is open source. If you're inclined to look at its java code, and suggest to us that what could be a possible fix and perhaps write and share a patch as well, that would be great and speed the incorporation of fix for this issue within Xerces-J.
> 
> 
>     was (Author: mukul_gandhi):
>     I do feel that, John's test cases point to unexpected behavior with Xerces-J, and may be a possible bug.
> 
>     @John: Xerces-J is open source. If you're inclined to look at its java code, and suggest to us what could be a possible fix and perhaps write and share a patch as well, that would be great and speed the incorporation of fix for this issue within Xerces-J.
> 
>         > > Possible Bug: Xerces 2.12.1 for XML Validation with XSD 1.1 Schema under Java
> >         -----------------------------------------------------------------------------
> > 
> >     > 
>         > > Key: XERCESJ-1726
> >         URL: https://issues.apache.org/jira/browse/XERCESJ-1726
> >         Project: Xerces2-J
> >         Issue Type: Bug
> >         Components: Samples
> >         Affects Versions: 2.12.1
> >         Environment: Windows 7
> >         Java 1.8.0_261
> >         Xerces-J 2.12.1
> >         Reporter: J Morris
> >         Priority: Major
> >         Labels: test
> >         Attachments: testX.zip, test_cases_ mukul.zip
> > 
> >     > 
>         > > Original Estimate: 72h
> >         Remaining Estimate: 72h
> > 
> >     > 
>         > > I have recently been trying to validate the XML file *test1.xml* with a schema *test.xsd* containing *assert*/*assertion* constructs, using the sample program *jaxp.SourceValidator*.
> >         Unexpectedly, the result was several reported errors in what appeared to be syntactically correct and valid XML lines (*test1.xml*: 9 errors).
> >         After significant experimentation, it appeared that these errors were occurring at line numbers which the validation found troublesome. Inserting an extra line at one of the troublesome line numbers made the previously erroneous line (now *not* appearing at a troublesome line number) pass validation. On the other hand, the newly inserted line (occupying the troublesome line number) would fail validation.
> >         I tentatively interpreted this as meaning that *the validation errors were not real* and began to try to develop a test-case, as similar as possible to *test1.xml*, but which passed validation. The result was *test2.xml*, which was generated from *test1.xml* by inserting XML comment lines at each of the troublesome line numbers, thereby displacing the previously erroneous lines to non-trooublesome line numbers. Since XML comment lines do not require validation, this file passed validation for me (*test2.xml*: 0 errors).
> >         I then contacted Mukul GANDHI and he re-ran my validations *but came to a different result*. He saw errors in both XML files (*test1.xml*: 9 errors; *test2.xml*: 18 errors). Despite our joint efforts to achieve convergence between our respective validation runs, we have not so far succeeded.
> >         Mukul did point out a couple of things:
> >         1) The way that I was using the "matches" function in the *assert* constructs. His experience suggested that this was unreliable. However, I was not certain whether this would have led to the type of behaviour that I was seeing (apparent troublesome line numbers).
> >         2) He found that certain characters (probably the two accented French characters) in my XML files were not supported in the default XML encoding scheme, UTF-8. However, for me, no errors were reported for those by the validation program *jaxp.SourceValidator*.
> >         I would be very gratefull foe some help in getting to the bottom of this (both the original behaviour and the discrepancies with Mukul's validation runs).
> > 
> >     > 
> 
>     --
>     This message was sent by Atlassian Jira
>     (v8.3.4#803005)
> 
>     ---------------------------------------------------------------------
>     To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org mailto:j-dev-unsubscribe@xerces.apache.org
>     For additional commands, e-mail: j-dev-help@xerces.apache.org mailto:j-dev-help@xerces.apache.org
> 

Re: [jira] [Comment Edited] (XERCESJ-1726) Possible Bug: Xerces 2.12.1 for XML Validation with XSD 1.1 Schema under Java

Posted by Elliotte Rusty Harold <el...@ibiblio.org>.
>> Is there anything that I can do to make that more likely to happen?
>

Yes, you can contract with and fund a committer (I am not one) to do
the work you're asking them to do. In my experience on other projects,
even a token thousand dollar payment (well below market rate for the
caliber of developers you'll find here and the amount of time that
would be required to resolve this) is often enough to get a bug fixed
that is otherwise ignored. Absent that, you're waiting for some
developer to have the same itch to scratch you do and volunteer their
time.

-- 
Elliotte Rusty Harold
elharo@ibiblio.org

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


Re: [jira] [Comment Edited] (XERCESJ-1726) Possible Bug: Xerces 2.12.1 for XML Validation with XSD 1.1 Schema under Java

Posted by Mukul Gandhi <mu...@apache.org>.
Hi John,

On Sat, Feb 20, 2021 at 5:54 PM JOHN Morris <j....@ntlworld.com.invalid>
wrote:

> Have you, in the past on this thread, told me the correct URL for the
> Xerces-j source code on Git? If not, could you provide that now?
>
For Xerces-J's XML Schema 1.1 implementation, the source code is located on
SVN branch xml-schema-1.1-dev (location
https://svn.apache.org/repos/asf/xerces/java/branches/xml-schema-1.1-dev/).

> I think I don't have any source code for the following in the various
> "src" areas within the installations of Xerces-J and JDK:
>
>    - cupv10k-runtime.jar
>    - icu4j.jar
>    - resolver.jar
>    - serializer.jar
>
> For these jar files, that are shipped with Xerces-J's XML Schema 1.1
implementation, source code would typically not be required for solving the
problem you've posted.


-- 
Regards,
Mukul Gandhi

Re: [jira] [Comment Edited] (XERCESJ-1726) Possible Bug: Xerces 2.12.1 for XML Validation with XSD 1.1 Schema under Java

Posted by JOHN Morris <j....@ntlworld.com.INVALID>.
Hi Mukul,

Many thanks for that.

Have you, in the past on this thread, told me the correct URL for the Xerces-j source code on Git? If not, could you provide that now?

I think I don't have any source code for the following in the various "src" areas within the installations of Xerces-J and JDK:

* cupv10k-runtime.jar
* icu4j.jar
* resolver.jar
* serializer.jar

plus a sprinkling of other individual class definition files for classes present in the other ".jar" files.

I guess these problems will be sorted by using the source files from GIT (?)

All the best,

John.

> On 20 February 2021 at 08:32 Mukul Gandhi <mu...@apache.org> wrote:
> 
>     Hi John,
> 
>     On Wed, Feb 17, 2021 at 6:29 PM JOHN Morris <j....@ntlworld.com.invalid> wrote:
> 
>         > > 
> >         Am I correct in thinking that no-one on the Xerces developer side has picked up my error report and is investigating it?
> > 
> >     >     I had earlier analyzed the bug report which you've reported. My conclusion was that, it could be a bug in Xerces. I personally couldn't get enough time, to arrive at a fix for the bug which you had reported. 
> 
>         > > 
> >          
> > 
> >         Is there anything that I can do to make that more likely to happen?
> > 
> >     >     If you wish, you may try solving this problem yourself and share with us the solution, which we can retest and commit to SVN.
> 
>     You may either use the Xerces source code from SVN and not use XPath 2.0 sources but only its jar,
>     or you may use the Xerces XPath 2.0 processor's source code as well (available at https://git.eclipse.org/c/sourceediting/webtools.sourceediting.xpath.git/ branch R3_2_maintenance).
> 
> 
> 
>     --
>     Regards,
>     Mukul Gandhi
> 

Re: [jira] [Comment Edited] (XERCESJ-1726) Possible Bug: Xerces 2.12.1 for XML Validation with XSD 1.1 Schema under Java

Posted by Mukul Gandhi <mu...@apache.org>.
Hi John,

On Wed, Feb 17, 2021 at 6:29 PM JOHN Morris <j....@ntlworld.com.invalid>
wrote:

> Am I correct in thinking that no-one on the Xerces developer side has
> picked up my error report and is investigating it?
>
I had earlier analyzed the bug report which you've reported. My conclusion
was that, it could be a bug in Xerces. I personally couldn't get enough
time, to arrive at a fix for the bug which you had reported.

> Is there anything that I can do to make that more likely to happen?
>
If you wish, you may try solving this problem yourself and share with us
the solution, which we can retest and commit to SVN.

You may either use the Xerces source code from SVN and not use XPath 2.0
sources but only its jar,
or you may use the Xerces XPath 2.0 processor's source code as well
(available at
https://git.eclipse.org/c/sourceediting/webtools.sourceediting.xpath.git/
branch R3_2_maintenance).



-- 
Regards,
Mukul Gandhi