Dear Xerces-J users, I enabled a prototype of Maven for Xerces-j on top of the "xml-schema-1.1-dev" Git branch to build and test with Netbeans - any IDE supporting Maven, see https://github.com/svanteschubert/xerces-j/tree/maven-prototype
Aimed to change as little as possible at the beginning: 1. Moved all Java files of the "src" directory to "src/main/java" 2. Moved all *.properties files of the "src" directory to "src/main/resources" 3. Copied the tests of the "xml-schema-1.1-tests" git branch from "src" to "src/main/test" in the "xml-schema-1.1-dev" branch 4. Copied the test files of the "xml-schema-1.1-tests" git branch from "data" to "src/main/resources" in the "xml-schema-1.1-dev" branch 5. The pom.xml was initialized from https://repo1.maven.org/maven2/xerces/xercesImpl/2.12.2/xercesImpl-2.12.2.pom 6. Afterwards, the pom.xml was enriched from the pom.xml of the former Apache Incubator project ODF Toolkit/ODFDOM 7. The .github directory was overtaken/adapted from the former Apache Incubator project ODF Toolkit/ODFDOM 8. Some JARs are yet not on Maven and were still reused locally from the tools directory By this with every commit regression testing is triggered on GitHub, so you might far easier see and reproduce my problem: https://github.com/svanteschubert/xerces-j/actions/runs/10840565076/job/30083097656#step:4:554 Likely the root problem is that the correct SchemaFactory is not found and the JDK 8 internal Xerces is being taken. Does anybody know the fix? Likely it is a common problem... I will discuss the challenges of the Maven build in the next few days on the dev list...no need to continue, if nobody is interested... Greetings from Germany, Svante On Thu, 12 Sept 2024 at 18:45, Svante Schubert <svanteschub...@apache.org> wrote: > Can anyone please provide feedback if it can be produced that the > AllXercesXSD11Tests > <https://github.com/apache/xerces-j/blob/xml-schema-1.1-tests/src/org/apache/xerces/tests/AllXercesXSD11Tests.java> > are failing? > > 1. for the downloaded Xerces 1.1 version > > <https://dlcdn.apache.org//xerces/j/binaries/Xerces-J-bin.2.12.2-xml-schema-1.1.zip> > ? > 2. for the Xerces 1.1 dev GitHub branch? > 3. that the earlier-mentioned test should fail as it did due to the > duplicated named global element declaration? > Sorry, but I did earlier a shell-game trick to myself and added not an > official Xerces1.1.jar but my previous AllXercesXSD11Tests > > <https://github.com/apache/xerces-j/blob/xml-schema-1.1-tests/src/org/apache/xerces/tests/AllXercesXSD11Tests.java> > only > failed correctly in my local test branch, where I added prefix support for > the loaded XSDs at run-time...still, tests fail for the official Xerces 1.1 > release. > > I tested now two different official Xerces 1.1 versions (and added > Netbeans IDE build environment to two commits of my prototype branch > smoke-testing) > > 1. a Netbeans environment using the downloaded Xerces 1.1 version > > <https://github.com/apache/xerces-j/commit/1930cbe2ec1a4d5e4df4a685c60b66a86745e285> > 2. a Netbeans environment using the Xerces 1.1 dev GitHub branch > > <https://github.com/apache/xerces-j/commit/57dcf82032d874c9bed5851349635e7c0a1131f1> > > Netbeans build and debug environment is easily addable for the > xml-schema-1.1-tests GitHub branch of Xerces by creating a new > Netbeans project and > > - In case Netbeans debug support for downloaded Xerces 1.1 ZIP > > <https://dlcdn.apache.org//xerces/j/binaries/Xerces-J-bin.2.12.2-xml-schema-1.1.zip> > : > Add all JARs from the downloaded ZIP of Xerces 1.1 to the classpath - > switch to JDK 8 (as afterwards JDKs API changed, e.g. tools.jar not > available) > > > - In case Netbeans debug support for Github branch xml-schema-1.1-dev: > Checkout from Github the xml-schema-1.1-dev branch and add in Netbeans > src and sample as source directories, use JDK 8 and add the JARs from the > tools directory (aside from XercesImp.jar), which will be built. > Afterwards, add the newly created Xerces JAR and the previously added > JARs to your other xml-schema-1.1-tests Netbeans project. > JUnit and Hamcrest will be added by Netbeans automatically > when problems are resolved > > Quite cumbersome, I think it's about time to add Maven support... :-) > > Two questions in the end regarding the current GitHub branch structure: > > 1. Why is the xml-schema-1.1-dev GitHub branch not placed at the top > of the main branch? XSD 1.1 specs states to be backward compatible with XSD > 1.0. > 2. Why are the tests of the xml-schema-1.1-tests GitHub branch not > added as well to the main branch? > 3. In case a Maven to build (and test) is being added, regression > tests could be made on GitHub for every commit to keep the branches from > becoming red. > > Currently, there are multiple versions of sources for Xerces > The different Xerces sources able to be downloaded as ZIP and the > differences between Subversion and the GitHub branches make it complex for > newcomers. > Is there still a reason that prevents these minimize the amount of Xerces > sources, I suggest the main branch of GitHub as the latest and greatest > source, using Git labels for releases. > > Thanks for any feedback, > Svante > > > On Thu, 12 Sept 2024 at 13:58, Svante Schubert <svante.schub...@gmail.com> > wrote: > >> 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/apache/xerces/tests/ConditionalInclusionTests.java#L81 >> >> org.xml.sax.SAXParseException; systemId: >> file:///E:/dev/tausch/xml/xsd-debug/xml-schema-1.1-tests/data/version-control/test37.xsd; >> lineNumber: 7; columnNumber: 46; >> *sch-props-correct.2: Ein Schema kann nicht zwei globale Komponenten mit >> demselben Namen enthalten. Dieses Schema enth�lt zwei Vorkommen von >> ',test'.* >> at >> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:204) >> at >> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:135) >> at >> com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:396) >> at >> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaErr(XSDHandler.java:4204) >> at >> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaError(XSDHandler.java:4187) >> at >> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.checkForDuplicateNames(XSDHandler.java:3820) >> at >> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.buildGlobalNameRegistries(XSDHandler.java:1362) >> at >> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.parseSchema(XSDHandler.java:651) >> at >> com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadSchema(XMLSchemaLoader.java:610) >> at >> com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadGrammar(XMLSchemaLoader.java:569) >> at >> com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadGrammar(XMLSchemaLoader.java:535) >> at >> com.sun.org.apache.xerces.internal.jaxp.validation.XMLSchemaFactory.newSchema(XMLSchemaFactory.java:269) >> at javax.xml.validation.SchemaFactory.newSchema(SchemaFactory.java:638) >> * at >> org.apache.xerces.tests.ConditionalInclusionTests.testVersionControl3(ConditionalInclusionTests.java:81) >> <https://github.com/svanteschubert/xerces-j/blob/smoke-testing/src/org/apache/xerces/tests/ConditionalInclusionTests.java#L81>* >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> at >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) >> at >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.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(JUnitTestRunner.java:535) >> at >> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:1197) >> at >> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:1042) >> >> On Thu, 12 Sept 2024 at 08:24, Svante Schubert <svanteschub...@apache.org> >> wrote: >> >>> Dear Xerces user group, >>> >>> Let me add the specification reference to the invalidness of the test >>> file >>> <https://github.com/apache/xerces-j/blob/xml-schema-1.1-tests/data/version-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 < >>> svante.schub...@gmail.com> 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/apache/xerces/tests/AllXercesXSD11Tests.java#L31> >>>> fails for me using my Xerces Jar from a build of Xerces 1.1 GitHub >>>> branch <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/version-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 & debug >>>> environment for my set of IDEs (Apache Netbeans & Intellij IDEA) >>>> represented >>>> by a single commit of noise >>>> >>>> <https://github.com/svanteschubert/xerces-j/commit/7e32264aabbb366360d6a354d2589e1e154fb58f> >>>> . >>>> 2. Instead of setting an environment variable, I hard coded the >>>> path to my tests >>>> >>>> <https://github.com/svanteschubert/xerces-j/commit/2c50b9c6dc88c5394af95d12f6cad9cced822e9e> >>>> . >>>> 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 >>>> something >>>> basic wrong. >>>> >>>> Thanks for any help! >>>> Svante >>>> >>>