You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by JOHN Morris <j....@ntlworld.com.INVALID> on 2020/08/18 20:42:02 UTC

Possible Bug: Xerces 2.12.1 for XML Validation with XSD 1.1 Schema under Java

Hi,  

I am a relative newcomer to Xerces for XML Validation.  

I have been trying to replicate the results of a tutorial that I found on the
Internet. with particular reference to XSD Schema 1.1 features, Over time, I
have tried using **Xerces 2.12.1** , along with **various JDK versions (7, 8,
13)**. Currently, I am using the validation capabilities of the
**jaxp.TypeInfoWriter** program.  

Recently, I have begun to look at the XSD 1.1 **assert** / **assertion**
features with a longer XML file.  

I have used two sample XML files:  

1) The first has more than 200 **element** s, one following hard on the
previous one.  

With this file, I find that there are particular line numbers that give
trouble in the validation process, although the XML content of those lines
appears to be legal and valid.  

Moving the complete XML code from one of the troublesome lines to another
position, makes the same code in its new postion **pass the validation** but
**now another new error occurs** with a new XML contruct, which now appears
**at the troublesome line number**.  

2) The same XML file as in (1) but with **XML comment lines** introduced at
each of the troublesome line numbers so that no validation is now required at
those lines. It should be noted, however, that the troublesome lines from case
(1) still appear, immediately after each of the new comment lines. **The
validation now passes completely**.  

I am currently assuming that this behaviour (i.e. the errors) is unexpected.  

I can provide a **ZIP file** with these test cases. (I did try to send the
e-mail posting this incident to the mailing list, complete with the
attachment, but it did not post. Can someone tell me whether attachments are
supported on this mailing list)?  

The a **ZIP file** comprises a directory, **testX** , with following contents:  

 **java_xercesX.bat** \- the batch file to run the test cases  

 **test.xsd** \- the XSD 1.1 Schema file  

 **test1.xml** \- the first XML file, **without** the extra comment lines  

 **test2.xml** \- the second XML file, **with** the extra comment lines  

 **xml_diffs.out** \- the result of a comparison (with the  " **fc** "
program) of the content of the two XML files  

In order to be able to run these test cases, you would have to **unzip** the
attached file, go to the **testX** directory and update the paths in the few
few lines of the file **java_xercesX.bat** to suit your system. Then, to run
one test case, you would use:  

 **java_xercesX** ** jaxp.TypeInfoWriter test.xsd test1.xml**  

for example, to validate **test1.xml**. (This batch file currently uses JDK8).  

Results of my validations of the two test files are provided in **test1.out**
and **test2.out** , also in the **testX** directory.  

I look forward to getting some feedback on this **possible bug**.  

Please do not hesitate to ask questions or to point out anything foolish that
I have been doing.  

Regards,

John MORRIS,  

Abingdon, UK.  

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