Re: Seek for advice with Xerces xml-schema-1.1-tests
Svante Schubert <[email protected]> Thu, 12 Sep 2024 13:58:02 +0200
| Newsgroups | gmane.text.xml.xerces-j.user |
|---|---|
| Message-ID | <CAHNbw8=P7tXwJq_-zOv5tZNBZjej+uaUKd-9dA-KPjdQsf9Q2w@mail.gmail.com> |
--000000000000546f4e0621ead2b4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable PS: To ease reproduction, I have added a stack trace (below) - note below is just the German-translated version of the error message mentioned earlier: "*sch-props-correct.2: An XSD schema cannot contain two global components with the same name.*" and the SaxParseException is already thrown when creating the Schema, even before the test: https://github.com/svanteschubert/xerces-j/blob/smoke-testing/src/org/apach= e/xerces/tests/ConditionalInclusionTests.java#L81 org.xml.sax.SAXParseException; systemId: file:///E:/dev/tausch/xml/xsd-debug/xml-schema-1.1-tests/data/version-contr= ol/test37.xsd; lineNumber: 7; columnNumber: 46; *sch-props-correct.2: Ein Schema kann nicht zwei globale Komponenten mit demselben Namen enthalten. Dieses Schema enth=EF=BF=BDlt zwei Vorkommen von ',test'.* at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseE= xception(ErrorHandlerWrapper.java:204) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHand= lerWrapper.java:135) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErr= orReporter.java:396) at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSche= maErr(XSDHandler.java:4204) at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSche= maError(XSDHandler.java:4187) at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.checkForDu= plicateNames(XSDHandler.java:3820) at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.buildGloba= lNameRegistries(XSDHandler.java:1362) at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.parseSchem= a(XSDHandler.java:651) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadSchema(XMLSc= hemaLoader.java:610) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadGrammar(XMLS= chemaLoader.java:569) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadGrammar(XMLS= chemaLoader.java:535) at com.sun.org.apache.xerces.internal.jaxp.validation.XMLSchemaFactory.newSche= ma(XMLSchemaFactory.java:269) at javax.xml.validation.SchemaFactory.newSchema(SchemaFactory.java:638) * at org.apache.xerces.tests.ConditionalInclusionTests.testVersionControl3(Condi= tionalInclusionTests.java:81) <https://github.com/svanteschubert/xerces-j/blob/smoke-testing/src/org/apac= he/xerces/tests/ConditionalInclusionTests.java#L81>* at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:6= 2) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp= l.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at junit.framework.TestCase.runTest(TestCase.java:177) at junit.framework.TestCase.runBare(TestCase.java:142) at junit.framework.TestResult$1.protect(TestResult.java:122) at junit.framework.TestResult.runProtected(TestResult.java:142) at junit.framework.TestResult.run(TestResult.java:125) at junit.framework.TestCase.run(TestCase.java:130) at junit.framework.TestSuite.runTest(TestSuite.java:241) at junit.framework.TestSuite.run(TestSuite.java:236) at junit.framework.TestSuite.runTest(TestSuite.java:241) at junit.framework.TestSuite.run(TestSuite.java:236) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestR= unner.java:535) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTe= stRunner.java:1197) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTest= Runner.java:1042) On Thu, 12 Sept 2024 at 08:24, Svante Schubert <[email protected]> wrote: > Dear Xerces user group, > > Let me add the specification reference to the invalidness of the test fil= e > <https://github.com/apache/xerces-j/blob/xml-schema-1.1-tests/data/versio= n-control/test37.xsd#L5> > : https://www.w3.org/TR/xmlschema11-1/#concepts-nameSymbolSpaces > *"But it is not possible for ... two distinct top-level element > declarations, to share the name my:abc"* > > If the build were in Maven and nightly tests were run by GitHub, I would > not ask this question. Perhaps it is worth considering a switch from Ant = to > Maven? > In general, invalid test files should be explicitly marked as such like > within a subfolder 'invalid'. > Would be helpful to download groups of test files from Maven, like > versions of deliverables as well (but this might be a topic for Maven's > user's list)... > > Still, I believe I am doing an oversight... > > Best regards, > Svante > > PS: Used my Apache email now and am uncertain if I should have started on > the dev list right away instead of users - I would join these lists for > software in general... (as you want to users become developers..) > > On Wed, 11 Sept 2024 at 15:25, Svante Schubert <[email protected]= > > wrote: > >> Dear experts, >> >> I am in need of some advice using the new Xerces xml-schema-1.1-tests >> <https://github.com/apache/xerces-j/tree/xml-schema-1.1-tests>. >> >> The test suite of org.apache.xerces.tests.AllXercesXSD11Tests >> <https://github.com/apache/xerces-j/blob/xml-schema-1.1-tests/src/org/ap= ache/xerces/tests/AllXercesXSD11Tests.java#L31> >> fails for me using my Xerces Jar from a build of Xerces 1.1 GitHub branc= h >> <https://github.com/apache/xerces-j/tree/xml-schema-1.1-dev> and likely >> I am missing something obvious. >> The error given is "*sch-props-correct.2: An XSD schema cannot contain >> two global components with the same name.*" and *the test file does have >> two global element name declarations with the same name* >> <https://github.com/apache/xerces-j/blob/xml-schema-1.1-tests/data/versi= on-control/test37.xsd#L5>, >> still the test is not meant to fail. >> >> What did I miss? >> >> My steps to do my smoke testing: >> >> 1. As I am not able to easily build & debug with my IDEs (like with >> Maven) using the existing ANT scripts, I generated an easy build & de= bug >> environment for my set of IDEs (Apache Netbeans & Intellij IDEA) repr= esented >> by a single commit of noise >> <https://github.com/svanteschubert/xerces-j/commit/7e32264aabbb366360= d6a354d2589e1e154fb58f> >> . >> 2. Instead of setting an environment variable, I hard coded the path >> to my tests >> <https://github.com/svanteschubert/xerces-j/commit/2c50b9c6dc88c5394a= f95d12f6cad9cced822e9e> >> . >> 3. Executed in Netbeans test suite >> org.apache.xerces.tests.AllXercesXSD11Tests >> <https://github.com/apache/xerces-j/blob/xml-schema-1.1-tests/src/org= /apache/xerces/tests/AllXercesXSD11Tests.java#L31> and >> getting aside of the above so many errors that I must have done somet= hing >> basic wrong. >> >> Thanks for any help! >> Svante >> > --000000000000546f4e0621ead2b4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div>PS:</div>To ease reproduction, I have added a stack t= race (below) - note below is just the German-translated version of the erro= r message mentioned earlier:<div>"<b><i>sch-props-correct.2: An XSD sc= hema cannot contain two global components with the same name.</i></b>"= </div><div>and the SaxParseException is already thrown=C2=A0when creating t= he Schema, even before the test:</div><div><a href=3D"https://github.com/sv= anteschubert/xerces-j/blob/smoke-testing/src/org/apache/xerces/tests/Condit= ionalInclusionTests.java#L81">https://github.com/svanteschubert/xerces-j/bl= ob/smoke-testing/src/org/apache/xerces/tests/ConditionalInclusionTests.java= #L81</a><br></div><div><br></div><div>org.xml.sax.SAXParseException; system= Id: file:///E:/dev/tausch/xml/xsd-debug/xml-schema-1.1-tests/data/version-c= ontrol/test37.xsd; lineNumber: 7; columnNumber: 46;<br></div><div><b>sch-pr= ops-correct.2: Ein Schema kann nicht zwei globale Komponenten mit demselben= Namen enthalten. Dieses Schema enth=EF=BF=BDlt zwei Vorkommen von ',te= st'.</b><br> at com.sun.org.apache.xerces.internal.util.ErrorHandlerWra= pper.createSAXParseException(ErrorHandlerWrapper.java:204)<br> at com.sun.o= rg.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrappe= r.java:135)<br> at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter= .reportError(XMLErrorReporter.java:396)<br> at com.sun.org.apache.xerces.in= ternal.impl.xs.traversers.XSDHandler.reportSchemaErr(XSDHandler.java:4204)<= br> at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.rep= ortSchemaError(XSDHandler.java:4187)<br> at com.sun.org.apache.xerces.inter= nal.impl.xs.traversers.XSDHandler.checkForDuplicateNames(XSDHandler.java:38= 20)<br> at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler= .buildGlobalNameRegistries(XSDHandler.java:1362)<br> at com.sun.org.apache.= xerces.internal.impl.xs.traversers.XSDHandler.parseSchema(XSDHandler.java:6= 51)<br> at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadS= chema(XMLSchemaLoader.java:610)<br> at com.sun.org.apache.xerces.internal.i= mpl.xs.XMLSchemaLoader.loadGrammar(XMLSchemaLoader.java:569)<br> at com.sun= .org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadGrammar(XMLSchemaLo= ader.java:535)<br> at com.sun.org.apache.xerces.internal.jaxp.validation.XM= LSchemaFactory.newSchema(XMLSchemaFactory.java:269)<br> at javax.xml.valida= tion.SchemaFactory.newSchema(SchemaFactory.java:638)<br><b> at <a href=3D"h= ttps://github.com/svanteschubert/xerces-j/blob/smoke-testing/src/org/apache= /xerces/tests/ConditionalInclusionTests.java#L81">org.apache.xerces.tests.C= onditionalInclusionTests.testVersionControl3(ConditionalInclusionTests.java= :81)</a></b><br> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Met= hod)<br> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccesso= rImpl.java:62)<br> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Deleg= atingMethodAccessorImpl.java:43)<br> at java.lang.reflect.Method.invoke(Met= hod.java:498)<br> at junit.framework.TestCase.runTest(TestCase.java:177)<br= > at junit.framework.TestCase.runBare(TestCase.java:142)<br> at junit.frame= work.TestResult$1.protect(TestResult.java:122)<br> at junit.framework.TestR= esult.runProtected(TestResult.java:142)<br> at junit.framework.TestResult.r= un(TestResult.java:125)<br> at junit.framework.TestCase.run(TestCase.java:1= 30)<br> at junit.framework.TestSuite.runTest(TestSuite.java:241)<br> at jun= it.framework.TestSuite.run(TestSuite.java:236)<br> at junit.framework.TestS= uite.runTest(TestSuite.java:241)<br> at junit.framework.TestSuite.run(TestS= uite.java:236)<br> at org.apache.tools.ant.taskdefs.optional.junit.JUnitTes= tRunner.run(JUnitTestRunner.java:535)<br> at org.apache.tools.ant.taskdefs.= optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:1197)<br> at org= .apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRun= ner.java:1042)<br></div></div><br><div class=3D"gmail_quote"><div dir=3D"lt= r" class=3D"gmail_attr">On Thu, 12 Sept 2024 at 08:24, Svante Schubert <= <a href=3D"mailto:[email protected]">[email protected]</a>&= gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0= px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div = dir=3D"ltr"><div>Dear Xerces user group,</div><div><br></div>Let me add the= specification reference to the <a href=3D"https://github.com/apache/xerces= -j/blob/xml-schema-1.1-tests/data/version-control/test37.xsd#L5" target=3D"= _blank">invalidness of the test file</a>:=C2=A0<a href=3D"https://www.w3.or= g/TR/xmlschema11-1/#concepts-nameSymbolSpaces" target=3D"_blank">https://ww= w.w3.org/TR/xmlschema11-1/#concepts-nameSymbolSpaces</a><div><b><i>"Bu= t it is not possible for ... two distinct top-level element declarations, t= o share the name=C2=A0<span style=3D"color:rgb(0,0,0);font-family:monospace= ;font-size:13px">my:abc</span>"</i></b></div><div><br></div><div>If th= e build were in Maven and nightly tests were run by GitHub, I would not ask= this question. Perhaps it is worth considering a switch from Ant to Maven?= </div><div>In general, invalid test files should be explicitly marked as su= ch like within a subfolder 'invalid'.=C2=A0</div><div>Would be help= ful to download groups of test files from Maven, like versions of deliverab= les as well (but this might be a topic for Maven's user's list)...<= /div><div><br></div><div>Still, I believe I am doing an oversight...</div><= div><br></div><div>Best regards,</div><div>Svante</div><div><br></div><div>= PS: Used my Apache email now and am uncertain if I should have started on t= he dev list right away instead of users - I would join these lists for soft= ware in general... (as you want to users become developers..)</div></div><b= r><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Wed, = 11 Sept 2024 at 15:25, Svante Schubert <<a href=3D"mailto:svante.schuber= [email protected]" target=3D"_blank">[email protected]</a>> wrote:<br>= </div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;b= order-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr">De= ar experts,<div><br></div><div>I am in need of some advice using the <a hre= f=3D"https://github.com/apache/xerces-j/tree/xml-schema-1.1-tests" target= =3D"_blank">new Xerces=C2=A0xml-schema-1.1-tests</a>.</div><div><br></div><= div>The <a href=3D"https://github.com/apache/xerces-j/blob/xml-schema-1.1-t= ests/src/org/apache/xerces/tests/AllXercesXSD11Tests.java#L31" target=3D"_b= lank">test suite of org.apache.xerces.tests.AllXercesXSD11Tests</a> fails f= or me using my Xerces Jar from a build of=C2=A0<a href=3D"https://github.co= m/apache/xerces-j/tree/xml-schema-1.1-dev" target=3D"_blank">Xerces 1.1 Git= Hub branch</a> and likely I am=C2=A0missing something obvious.</div><div>Th= e error given is "<b><i>sch-props-correct.2: An XSD schema cannot cont= ain two global components with the same name.</i></b>" and <a href=3D"= https://github.com/apache/xerces-j/blob/xml-schema-1.1-tests/data/version-c= ontrol/test37.xsd#L5" target=3D"_blank"><i><b>the test file does have two g= lobal element name declarations=C2=A0with the same name</b></i></a>, still = the test is not meant to fail.=C2=A0</div><div><br></div><div>What did I mi= ss?</div><div><br></div><div>My steps to do my smoke testing:</div><div><ol= ><li>As I am not able to easily build & debug with my IDEs (like with M= aven) using the existing ANT scripts, I generated an easy build & debug= environment for my set of IDEs (Apache Netbeans & Intellij IDEA) repre= sented<a href=3D"https://github.com/svanteschubert/xerces-j/commit/7e32264a= abbb366360d6a354d2589e1e154fb58f" target=3D"_blank"> by a single commit of = noise</a>.</li><li>Instead of setting an environment=C2=A0variable, <a href= =3D"https://github.com/svanteschubert/xerces-j/commit/2c50b9c6dc88c5394af95= d12f6cad9cced822e9e" target=3D"_blank">I hard coded the path to my tests</a= >.<br></li><li>Executed in Netbeans=C2=A0<a href=3D"https://github.com/apac= he/xerces-j/blob/xml-schema-1.1-tests/src/org/apache/xerces/tests/AllXerces= XSD11Tests.java#L31" target=3D"_blank">test suite org.apache.xerces.tests.A= llXercesXSD11Tests</a>=C2=A0and getting aside of the above so many errors t= hat I must have done something basic wrong.</li></ol></div><div>Thanks for = any help!</div><div>Svante</div></div> </blockquote></div> </blockquote></div> --000000000000546f4e0621ead2b4--