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

JOHN Morris <[email protected]> Tue, 18 Aug 2020 21:42:02 +0100 (BST)
Newsgroups gmane.text.xml.xerces-j.user
Message-ID <[email protected]>
<!DOCTYPE html>
<html><head>
    <meta charset=3D"UTF-8">
</head><body><div class=3D"ox-88b1217ee1-ox-e2c89d6142-abs ox-88b1217ee1-ox=
-e2c89d6142-window-content ox-88b1217ee1-ox-e2c89d6142-vsplit ox-88b1217ee1=
-ox-e2c89d6142-preview-none"><div class=3D"ox-88b1217ee1-ox-e2c89d6142-righ=
tside ox-88b1217ee1-ox-e2c89d6142-mail-detail-pane ox-88b1217ee1-ox-e2c89d6=
142-selection-one ox-88b1217ee1-ox-e2c89d6142-preview-visible"><div class=
=3D"ox-88b1217ee1-ox-e2c89d6142-thread-view-control ox-88b1217ee1-ox-e2c89d=
6142-abs ox-88b1217ee1-ox-e2c89d6142-back-navigation-visible"><div class=3D=
"ox-88b1217ee1-ox-e2c89d6142-thread-view-list ox-88b1217ee1-ox-e2c89d6142-s=
crollable ox-88b1217ee1-ox-e2c89d6142-abs" style=3D"display: block;"><div c=
lass=3D"ox-88b1217ee1-ox-e2c89d6142-thread-view ox-88b1217ee1-ox-e2c89d6142=
-list-view"><div class=3D"ox-88b1217ee1-ox-e2c89d6142-mail-detail-content o=
x-88b1217ee1-ox-e2c89d6142-noI18n ox-88b1217ee1-ox-e2c89d6142-simple-mail" =
style=3D"min-height: 834px;"><p>Hi,<br></p><p>I am a relative newcomer to X=
erces for XML Validation.<br></p><p>I have been trying to replicate the res=
ults of a tutorial that I found on the Internet. with particular reference =
to XSD Schema 1.1 features, Over time, I have tried using <strong>Xerces 2.=
12.1</strong>, along with <strong>various JDK versions (7, 8, 13)</strong>.=
 Currently, I am using the validation capabilities of the <strong>jaxp.Type=
InfoWriter</strong> program.<br></p><p>Recently, I have begun to look at th=
e XSD 1.1 <strong>assert</strong>/<strong>assertion</strong> features with =
a longer XML file.<br></p><p>I have used two sample XML files:<br></p><p>1)=
 The first has more than 200 <strong>element</strong>s, one following hard =
on the previous one.<br></p><p>With this file, I find that there are partic=
ular line numbers that give trouble in the validation process, although the=
 XML content of those lines appears to be legal and valid.<br></p><p>Moving=
 the complete XML code from one of the troublesome lines to another positio=
n, makes the same code in its new postion <strong>pass the validation</stro=
ng> but <strong>now another new error occurs</strong> with a new XML contru=
ct, which now appears <strong>at the troublesome line number</strong>.<br><=
/p><p>2) The same XML file as in (1) but with <strong>XML comment lines</st=
rong> introduced at each of the troublesome line numbers so that no validat=
ion is now required at those lines. It should be noted, however, that the t=
roublesome lines from case (1) still appear, immediately after each of the =
new comment lines. <strong>The validation now passes completely</strong>.<b=
r></p><p>I am currently assuming that this behaviour (i.e. the errors) is u=
nexpected.<br></p><p>I can provide a <strong>ZIP file</strong> with these t=
est cases. (I did try to send the e-mail posting this incident to the maili=
ng list, complete with the attachment, but it did not post. Can someone tel=
l me whether attachments are supported on this mailing list)?<br></p><p>The=
 a <strong>ZIP file</strong> comprises a directory, <strong>testX</strong>,=
 with following contents:<br></p><p style=3D"padding-left: 30px;"><strong>j=
ava_xercesX.bat</strong> - the batch file to run the test cases<br></p><p s=
tyle=3D"padding-left: 30px;"><strong>test.xsd</strong> - the XSD 1.1 Schema=
 file<br></p><p style=3D"padding-left: 30px;"><strong>test1.xml</strong> - =
the first XML file, <strong>without</strong> the extra comment lines<br></p=
><p style=3D"padding-left: 30px;"><strong>test2.xml</strong> - the second X=
ML file, <strong>with</strong> the extra comment lines<br></p><p style=3D"p=
adding-left: 30px;"><strong>xml_diffs.out</strong> - the result of a compar=
ison (with the &#34;<strong>fc</strong>&#34; program) of the content of the=
 two XML files<br></p><p>In order to be able to run these test cases, you w=
ould have to <strong>unzip</strong> the attached file, go to the <strong>te=
stX</strong> directory and update the paths in the few few lines of the fil=
e&#160;<strong>java_xercesX.bat</strong> to suit your system. Then, to run =
one test case, you would use:<br></p><p style=3D"padding-left: 30px;"><stro=
ng>java_xercesX</strong>&#160;<strong>&#160;jaxp.TypeInfoWriter test.xsd&#1=
60;test1.xml</strong> <br></p><p>for example, to validate <strong>test1.xml=
</strong>. (This batch file currently uses JDK8).<br></p><p>Results of my v=
alidations of the two test files are provided in <strong>test1.out</strong>=
 and <strong>test2.out</strong>, also in the <strong>testX</strong> directo=
ry.<br></p><p>I look forward to getting some feedback on this <strong>possi=
ble bug</strong>.<br></p><p>Please do not hesitate to ask questions or to p=
oint out anything foolish that I have been doing.<br></p><p class=3D"ox-88b=
1217ee1-ox-e2c89d6142-ox-fa09ab93ee-default-style">Regards,</p><p class=3D"=
ox-88b1217ee1-ox-e2c89d6142-ox-fa09ab93ee-default-style">John MORRIS,<br></=
p><p class=3D"ox-88b1217ee1-ox-e2c89d6142-ox-fa09ab93ee-default-style">Abin=
gdon, UK.<br></p></div></div></div></div></div></div></body></html>
=20