Re: Initial Maven build & test prototype for Xerces XSD 1.1 with GitHub cloud builds & tests on commits - earlier: Re: Seek for advice with Xerces xml-schema-1.1-tests

Svante Schubert <[email protected]> Fri, 13 Sep 2024 15:42:32 +0200
Newsgroups gmane.text.xml.xerces-j.user
Message-ID <CAHNbw8mwf7BLDFbraxDVU8_m0Qg1hj5nTBU+Hft2+q-udXVVEg@mail.gmail.com>
--000000000000d164b20622006574
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

I am getting closer, solved some riddles:

   1. I had German error messages instead of English ones, as the JDK
   Xerces has such language bundles (not the Apache Xerces), which confused=
 me
   at the beginning as Xerces did not have German translations - from my
   intermediate (unnecessary) changes, I just left the commit to using just
   one Singletone of a Locale object for Locale.getDefault provided now on
   constant, see commit
   <https://github.com/svanteschubert/xerces-j/commit/6a26b9382375032c67a97=
fe72e7d6193defddc58>
   .
   2. The Xerces JDK parser is taken wrongly, as some test cases are
   choosing explicitly to validate in XSD 1.0 mode (e.g. see
   ConditionalInclusionTests
   <https://github.com/svanteschubert/xerces-j/blob/maven-prototype/src/tes=
t/java/org/apache/xerces/tests/ConditionalInclusionTests.java#L76>),
   unfortunately, only for XSD 1.1 mode a factory was explicitly being give=
n:
   System.setProperty("javax.xml.validation.SchemaFactory:" +
   SCHEMA_11_LANGUAGE, SCHEMA_11_FACTORY);
   no factory was given for XSD 1.0, but was now added:
   System.setProperty("javax.xml.validation.SchemaFactory:" +
   SCHEMA_10_LANGUAGE, SCHEMA_10_FACTORY);
   After setting the above System property in the parent test class the
   Apache Xerces was being taken.
   *I would suggest setting both properties during loading Xerces! *
   Making Xerces the default when loading it, avoiding such problems for
   others.
   3. In the pom.xml
   <https://github.com/svanteschubert/xerces-j/blob/maven-prototype/pom.xml=
#L39>,
   I suggest using the first JDK LTS release after JDK's module refactoring=
,
   which is JDK 11.
   However I had problems with our PsychoPathXPathProcessor (XPath 2.0
   engine), which appeared as security exceptions, so I updated the version=
 -
   to the only version where sources are findable
   <https://mvnrepository.com/artifact/com.rackspace.eclipse.webtools.sourc=
eediting/org.eclipse.wst.xml.xpath2.processor>
   . PsychoPathXPathProcessor home at Eclipse looked abandoned.
   <https://wiki.eclipse.org/PsychoPathXPathProcessor/> Sources can not be
   viewed at Eclipse.
   *Perhaps someone has more knowledge and/or connection and can provide a
   link?*
   The downside of the version upgrade from version 1.2.1 to 2.1.100, there
   are some build issues due to API changes, on the bright side all JARs ar=
e
   on Maven Central:
   Calling on project root '*mvn dependency:tree -Dverbose*' shows:
   INFO] --- dependency:3.7.1:tree (default-cli) @ xercesImpl ---
   [INFO] xerces:xercesImpl:jar:2.12.3-SNAPSHOT
   [INFO] +- xml-apis:xml-apis:jar:1.4.01:compile
   [INFO] +- xml-resolver:xml-resolver:jar:1.2:compile
   [INFO] +- com.rackspace.eclipse.webtools.sourceediting
   :org.eclipse.wst.xml.xpath2.processor:jar:2.1.100:compile
   [INFO] |  +- edu.princeton.cup:java-cup:jar:10k:compile
   [INFO] |  \- com.ibm.icu:icu4j:jar:4.6:compile
   [INFO] \- junit:junit:jar:4.13.2:test
   [INFO]    \- org.hamcrest:hamcrest-core:jar:1.3:test
   No more JARs have to be bundled if this is working out! =F0=9F=A5=B3

Hope you are enjoying your Friday!
Svante




On Fri, 13 Sept 2024 at 02:33, Svante Schubert <[email protected]>
wrote:

> Getting tired, just a quick correction:
>
>    1. Copied the tests of the "xml-schema-1.1-tests" git branch from
>    "src" to "*src/test/java*" in the "xml-schema-1.1-dev" branch
>    2. Copied the test files of the "xml-schema-1.1-tests"  git branch
>    from "data" to "*src/test/resources*" in the "xml-schema-1.1-dev"
>    branch
>
>
> On Fri, 13 Sept 2024 at 02:28, Svante Schubert <[email protected]=
>
> wrote:
>
>> 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 ID=
E
>> 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" branc=
h
>>    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 <[email protected]=
g>
>> 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/a=
pache/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/or=
g/apache/xerces/tests/AllXercesXSD11Tests.java> only
>>>    failed correctly in my local test branch, where I added prefix suppo=
rt for
>>>    the loaded XSDs at run-time...still, tests fail for the official Xer=
ces 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/1930cbe2ec1a4d5e4df4a685c=
60b66a86745e285>
>>>    2. a Netbeans environment using the Xerces 1.1 dev GitHub branch
>>>    <https://github.com/apache/xerces-j/commit/57dcf82032d874c9bed585134=
9635e7c0a1131f1>
>>>
>>> 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 no=
t
>>>    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 b=
uilt.
>>>    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 w=
ith 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 <
>>> [email protected]> 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=EF=BF=BDlt zwei Vork=
ommen von
>>>> ',test'.*
>>>> at
>>>> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXP=
arseException(ErrorHandlerWrapper.java:204)
>>>> at
>>>> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Erro=
rHandlerWrapper.java:135)
>>>> at
>>>> com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(X=
MLErrorReporter.java:396)
>>>> at
>>>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.repor=
tSchemaErr(XSDHandler.java:4204)
>>>> at
>>>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.repor=
tSchemaError(XSDHandler.java:4187)
>>>> at
>>>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.check=
ForDuplicateNames(XSDHandler.java:3820)
>>>> at
>>>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.build=
GlobalNameRegistries(XSDHandler.java:1362)
>>>> at
>>>> com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.parse=
Schema(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.ne=
wSchema(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.j=
ava:62)
>>>> at
>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess=
orImpl.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(JUnit=
TestRunner.java:535)
>>>> at
>>>> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JU=
nitTestRunner.java:1197)
>>>> at
>>>> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUni=
tTestRunner.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
>>>>> file
>>>>> <https://github.com/apache/xerces-j/blob/xml-schema-1.1-tests/data/ve=
rsion-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 starte=
d
>>>>> on the dev list right away instead of users - I would join these list=
s 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-test=
s
>>>>>> <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/or=
g/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 na=
me*
>>>>>> <https://github.com/apache/xerces-j/blob/xml-schema-1.1-tests/data/v=
ersion-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 b=
uild &
>>>>>>    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/7e32264aabbb36=
6360d6a354d2589e1e154fb58f>
>>>>>>    .
>>>>>>    2. Instead of setting an environment variable, I hard coded the
>>>>>>    path to my tests
>>>>>>    <https://github.com/svanteschubert/xerces-j/commit/2c50b9c6dc88c5=
394af95d12f6cad9cced822e9e>
>>>>>>    .
>>>>>>    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 s=
omething
>>>>>>    basic wrong.
>>>>>>
>>>>>> Thanks for any help!
>>>>>> Svante
>>>>>>
>>>>>

--000000000000d164b20622006574
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I am getting closer, solved some riddles:<div><ol><li>I ha=
d German error messages instead of English ones, as the JDK Xerces has such=
 language bundles (not the Apache Xerces), which confused me at the beginni=
ng as Xerces did not=C2=A0have German translations - from my intermediate (=
unnecessary) changes, I just left the commit to using just one Singletone o=
f a Locale object for Locale.getDefault provided now on constant, see <a hr=
ef=3D"https://github.com/svanteschubert/xerces-j/commit/6a26b9382375032c67a=
97fe72e7d6193defddc58">commit</a>.</li><li>The Xerces JDK parser is taken w=
rongly, as some test cases are choosing explicitly to validate in XSD 1.0 m=
ode (e.g. see <a href=3D"https://github.com/svanteschubert/xerces-j/blob/ma=
ven-prototype/src/test/java/org/apache/xerces/tests/ConditionalInclusionTes=
ts.java#L76">ConditionalInclusionTests</a>), unfortunately, only for XSD 1.=
1 mode a factory was explicitly being given:<br>System.setProperty(&quot;ja=
vax.xml.validation.SchemaFactory:&quot; + SCHEMA_11_LANGUAGE, SCHEMA_11_FAC=
TORY);<br>no factory was given for XSD 1.0, but was now added:<br>System.se=
tProperty(&quot;javax.xml.validation.SchemaFactory:&quot; + SCHEMA_10_LANGU=
AGE, SCHEMA_10_FACTORY);<br>After setting the above System property in the =
parent test class the Apache Xerces was being taken.<br><b style=3D"backgro=
und-color:rgb(255,255,0)">I would suggest setting both properties during lo=
ading Xerces! </b><br>Making Xerces the default when loading it, avoiding s=
uch problems for others.</li><li>In the <a href=3D"https://github.com/svant=
eschubert/xerces-j/blob/maven-prototype/pom.xml#L39">pom.xml</a>, I suggest=
 using=C2=A0the first JDK LTS release after JDK&#39;s module refactoring, w=
hich is JDK 11.<br>However I had problems with our PsychoPathXPathProcessor=
 (XPath 2.0 engine), which appeared as security exceptions, so I updated th=
e version - to <a href=3D"https://mvnrepository.com/artifact/com.rackspace.=
eclipse.webtools.sourceediting/org.eclipse.wst.xml.xpath2.processor">the on=
ly version where sources are findable</a>.=C2=A0<a href=3D"https://wiki.ecl=
ipse.org/PsychoPathXPathProcessor/">PsychoPathXPathProcessor home at Eclips=
e looked abandoned.</a> Sources can not be viewed at Eclipse. <br><b style=
=3D"background-color:rgb(255,255,0)">Perhaps=C2=A0someone has more knowledg=
e and/or connection and can provide a link?</b><br>The downside of the vers=
ion upgrade from version 1.2.1 to 2.1.100, there are some build issues due =
to API changes, on the bright side all JARs are on Maven Central: <br>Calli=
ng on project root &#39;<i>mvn dependency:tree -Dverbose</i>&#39; shows:<br=
><font face=3D"monospace">INFO] --- dependency:3.7.1:tree (default-cli) @ x=
ercesImpl ---</font><br><font face=3D"monospace">[INFO] xerces:xercesImpl:j=
ar:2.12.3-SNAPSHOT</font><br><font face=3D"monospace">[INFO] +- xml-apis:xm=
l-apis:jar:1.4.01:compile</font><br><font face=3D"monospace">[INFO] +- xml-=
resolver:xml-resolver:jar:1.2:compile</font><br><font face=3D"monospace">[I=
NFO] +- </font>com.rackspace.eclipse.webtools.sourceediting<font face=3D"mo=
nospace">:org.eclipse.wst.xml.xpath2.processor:jar:2.1.100:compile</font><b=
r><font face=3D"monospace">[INFO] | =C2=A0+- edu.princeton.cup:java-cup:jar=
:10k:compile</font><br><font face=3D"monospace">[INFO] | =C2=A0\- com.ibm.i=
cu:icu4j:jar:4.6:compile</font><br><font face=3D"monospace">[INFO] \- junit=
:junit:jar:4.13.2:test</font><br><font face=3D"monospace">[INFO] =C2=A0 =C2=
=A0\- org.hamcrest:hamcrest-core:jar:1.3:test</font><br>No more JARs have t=
o be bundled if this is working out!=C2=A0=F0=9F=A5=B3</li></ol><div>Hope y=
ou are enjoying your Friday!</div><div>Svante</div><font face=3D"monospace"=
><br></font><br><br></div></div><br><div class=3D"gmail_quote"><div dir=3D"=
ltr" class=3D"gmail_attr">On Fri, 13 Sept 2024 at 02:33, Svante Schubert &l=
t;<a href=3D"mailto:[email protected]">[email protected]</a=
>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px=
 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><di=
v dir=3D"ltr"><div>Getting tired, just a quick correction:</div><ol><li sty=
le=3D"margin-left:15px">Copied the tests of the &quot;xml-schema-1.1-tests&=
quot; git branch from &quot;src&quot; to &quot;<b>src/test/java</b>&quot; i=
n the &quot;xml-schema-1.1-dev&quot; branch=C2=A0</li><li style=3D"margin-l=
eft:15px">Copied the test files of the &quot;xml-schema-1.1-tests&quot;=C2=
=A0 git branch from &quot;data&quot; to &quot;<b>src/test/resources</b>&quo=
t; in the &quot;xml-schema-1.1-dev&quot; branch=C2=A0</li></ol></div><br><d=
iv class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Fri, 13 S=
ept 2024 at 02:28, Svante Schubert &lt;<a href=3D"mailto:svanteschubert@apa=
che.org" target=3D"_blank">[email protected]</a>&gt; wrote:<br></di=
v><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;borde=
r-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr"><div d=
ir=3D"ltr"><div>Dear Xerces-J users,</div><div><br></div>I enabled a protot=
ype of Maven for Xerces-j on top of the &quot;xml-schema-1.1-dev&quot; Git =
branch to build and test with Netbeans - any IDE supporting Maven, see<div>=
<a href=3D"https://github.com/svanteschubert/xerces-j/tree/maven-prototype"=
 target=3D"_blank">https://github.com/svanteschubert/xerces-j/tree/maven-pr=
ototype</a></div><div><br></div><div>Aimed to change as little as possible =
at the beginning:</div><div><ol><li>Moved all Java files of the &quot;src&q=
uot; directory=C2=A0to &quot;src/main/java&quot;</li><li>Moved all *.proper=
ties files of the &quot;src&quot; directory to &quot;src/main/resources&quo=
t;</li><li>Copied the tests of the &quot;xml-schema-1.1-tests&quot; git bra=
nch from &quot;src&quot; to &quot;src/main/test&quot; in the &quot;xml-sche=
ma-1.1-dev&quot; branch=C2=A0</li><li>Copied the test files of the &quot;xm=
l-schema-1.1-tests&quot;=C2=A0

git branch from &quot;data&quot; to &quot;src/main/resources&quot; in the &=
quot;xml-schema-1.1-dev&quot; branch=C2=A0</li><li>The pom.xml was initiali=
zed from=C2=A0<a href=3D"https://repo1.maven.org/maven2/xerces/xercesImpl/2=
.12.2/xercesImpl-2.12.2.pom" target=3D"_blank">https://repo1.maven.org/mave=
n2/xerces/xercesImpl/2.12.2/xercesImpl-2.12.2.pom</a></li><li>Afterwards, t=
he pom.xml was enriched from the pom.xml of the former Apache Incubator pro=
ject ODF Toolkit/ODFDOM</li><li>The .github directory was overtaken/adapted=
 from the former Apache Incubator project ODF Toolkit/ODFDOM</li><li>Some J=
ARs are yet not on Maven and were still reused locally from the tools direc=
tory</li></ol></div><div><div>By this with every commit regression testing =
is triggered on GitHub, so you might far easier see and reproduce my proble=
m:<div><a href=3D"https://github.com/svanteschubert/xerces-j/actions/runs/1=
0840565076/job/30083097656#step:4:554" target=3D"_blank">https://github.com=
/svanteschubert/xerces-j/actions/runs/10840565076/job/30083097656#step:4:55=
4</a><br></div><div><br></div><div>Likely the root problem is that the corr=
ect SchemaFactory is not found and the JDK 8 internal Xerces is being taken=
.</div><div>Does anybody know=C2=A0the fix? Likely it is a common=C2=A0prob=
lem...</div><div><br></div><div>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...</div><div><br></div></div></div><div>Greetings from Germa=
ny,</div><div>Svante</div></div><br><div class=3D"gmail_quote"><div dir=3D"=
ltr" class=3D"gmail_attr">On Thu, 12 Sept 2024 at 18:45, Svante Schubert &l=
t;<a href=3D"mailto:[email protected]" target=3D"_blank">svanteschu=
[email protected]</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" s=
tyle=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);pad=
ding-left:1ex"><div dir=3D"ltr"><div>Can anyone please provide feedback if =
it can be produced that the <a href=3D"https://github.com/apache/xerces-j/b=
lob/xml-schema-1.1-tests/src/org/apache/xerces/tests/AllXercesXSD11Tests.ja=
va" target=3D"_blank">AllXercesXSD11Tests</a> are failing?<br></div><div><o=
l><li>for the <a href=3D"https://dlcdn.apache.org//xerces/j/binaries/Xerces=
-J-bin.2.12.2-xml-schema-1.1.zip" target=3D"_blank">downloaded Xerces 1.1 v=
ersion</a>?</li><li>for the Xerces 1.1 dev GitHub branch?</li><li>that the =
earlier-mentioned test should fail as it did due to the duplicated named gl=
obal element declaration?=C2=A0<br>Sorry, but I did earlier a shell-game tr=
ick to myself and added not an official Xerces1.1.jar but my previous=C2=A0=
<a href=3D"https://github.com/apache/xerces-j/blob/xml-schema-1.1-tests/src=
/org/apache/xerces/tests/AllXercesXSD11Tests.java" target=3D"_blank">AllXer=
cesXSD11Tests</a>=C2=A0only 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.</li></ol></div><div>I tested now two =
different official Xerces 1.1 versions (and added Netbeans IDE build enviro=
nment to two commits of my prototype branch smoke-testing)<br></div><div><o=
l><li><a href=3D"https://github.com/apache/xerces-j/commit/1930cbe2ec1a4d5e=
4df4a685c60b66a86745e285" target=3D"_blank">a Netbeans environment using th=
e=C2=A0downloaded Xerces 1.1 version</a></li><li><a href=3D"https://github.=
com/apache/xerces-j/commit/57dcf82032d874c9bed5851349635e7c0a1131f1" target=
=3D"_blank">a Netbeans environment using the Xerces 1.1 dev GitHub branch</=
a></li></ol><div>Netbeans build and debug environment is easily=C2=A0addabl=
e for the xml-schema-1.1-tests GitHub branch of Xerces by creating a new Ne=
tbeans=C2=A0project and=C2=A0</div></div><div><ul><li>In case Netbeans debu=
g support for <a href=3D"https://dlcdn.apache.org//xerces/j/binaries/Xerces=
-J-bin.2.12.2-xml-schema-1.1.zip" target=3D"_blank">downloaded Xerces 1.1 Z=
IP</a>:<br>Add all JARs from the downloaded ZIP of Xerces 1.1 to the classp=
ath - switch to JDK 8 (as afterwards JDKs API changed, e.g. tools.jar not a=
vailable)</li></ul><ul><li>In case Netbeans debug support for Github branch=
 xml-schema-1.1-dev:<br>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 b=
e built.<br>Afterwards, add the newly created Xerces JAR and the previously=
 added JARs to your other xml-schema-1.1-tests Netbeans project.<br>JUnit a=
nd Hamcrest will be added by Netbeans automatically when=C2=A0problems are =
resolved</li></ul></div><div>Quite cumbersome, I think it&#39;s about time =
to add Maven support... :-)</div><div><br></div><div>Two questions in the e=
nd regarding the current GitHub branch structure:</div><div><ol><li>Why is =
the xml-schema-1.1-dev GitHub branch not placed at the top of the main bran=
ch? XSD 1.1 specs states to be backward compatible with XSD 1.0.</li><li>Wh=
y are the tests of the xml-schema-1.1-tests GitHub branch not added as well=
 to the main branch?</li><li>In case a Maven to build=C2=A0(and test) is be=
ing added, regression tests could be made on GitHub for every commit to kee=
p the branches from becoming red.</li></ol><div>Currently, there are multip=
le=C2=A0versions of sources for Xerces=C2=A0</div><div>The different Xerces=
 sources able to be downloaded as ZIP and the differences between Subversio=
n and the GitHub branches make it complex for newcomers.</div><div>Is there=
 still a reason that prevents these minimize the amount of Xerces sources, =
I suggest the main branch of GitHub as the latest=C2=A0and greatest source,=
 using Git labels for releases.</div></div><div><br></div><div>Thanks for a=
ny feedback,</div><div>Svante</div><div><br></div></div><br><div class=3D"g=
mail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Thu, 12 Sept 2024 at 1=
3:58, Svante Schubert &lt;<a href=3D"mailto:[email protected]" targ=
et=3D"_blank">[email protected]</a>&gt; wrote:<br></div><blockquote=
 class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px so=
lid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr"><div>PS:</div>To ea=
se reproduction, I have added a stack trace (below) - note below is just th=
e German-translated version of the error message mentioned earlier:<div>&qu=
ot;<b><i>sch-props-correct.2: An XSD schema cannot contain two global compo=
nents with the same name.</i></b>&quot;</div><div>and the SaxParseException=
 is already thrown=C2=A0when creating the Schema, even before the test:</di=
v><div><a href=3D"https://github.com/svanteschubert/xerces-j/blob/smoke-tes=
ting/src/org/apache/xerces/tests/ConditionalInclusionTests.java#L81" target=
=3D"_blank">https://github.com/svanteschubert/xerces-j/blob/smoke-testing/s=
rc/org/apache/xerces/tests/ConditionalInclusionTests.java#L81</a><br></div>=
<div><br></div><div>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;<br></div><div><b>sch-props-correct.2: Ein=
 Schema kann nicht zwei globale Komponenten mit demselben Namen enthalten. =
Dieses Schema enth=EF=BF=BDlt zwei Vorkommen von &#39;,test&#39;.</b><br>	a=
t com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXPars=
eException(ErrorHandlerWrapper.java:204)<br>	at com.sun.org.apache.xerces.i=
nternal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:135)<br>	at=
 com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLEr=
rorReporter.java:396)<br>	at com.sun.org.apache.xerces.internal.impl.xs.tra=
versers.XSDHandler.reportSchemaErr(XSDHandler.java:4204)<br>	at com.sun.org=
.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaError(XSD=
Handler.java:4187)<br>	at com.sun.org.apache.xerces.internal.impl.xs.traver=
sers.XSDHandler.checkForDuplicateNames(XSDHandler.java:3820)<br>	at com.sun=
.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.buildGlobalNameRe=
gistries(XSDHandler.java:1362)<br>	at com.sun.org.apache.xerces.internal.im=
pl.xs.traversers.XSDHandler.parseSchema(XSDHandler.java:651)<br>	at com.sun=
.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadSchema(XMLSchemaLoa=
der.java:610)<br>	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLo=
ader.loadGrammar(XMLSchemaLoader.java:569)<br>	at com.sun.org.apache.xerces=
.internal.impl.xs.XMLSchemaLoader.loadGrammar(XMLSchemaLoader.java:535)<br>=
	at com.sun.org.apache.xerces.internal.jaxp.validation.XMLSchemaFactory.new=
Schema(XMLSchemaFactory.java:269)<br>	at javax.xml.validation.SchemaFactory=
.newSchema(SchemaFactory.java:638)<br><b>	at <a href=3D"https://github.com/=
svanteschubert/xerces-j/blob/smoke-testing/src/org/apache/xerces/tests/Cond=
itionalInclusionTests.java#L81" target=3D"_blank">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 &lt;=
<a href=3D"mailto:[email protected]" target=3D"_blank">svanteschube=
[email protected]</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" sty=
le=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);paddi=
ng-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.org/TR/xmlschema11-1/#concepts-nameSymbolSpaces" target=3D"=
_blank">https://www.w3.org/TR/xmlschema11-1/#concepts-nameSymbolSpaces</a><=
div><b><i>&quot;But it is not possible for ... two distinct top-level eleme=
nt declarations, to share the name=C2=A0<span style=3D"color:rgb(0,0,0);fon=
t-family:monospace;font-size:13px">my:abc</span>&quot;</i></b></div><div><b=
r></div><div>If the build were in Maven and nightly tests were run by GitHu=
b, 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 expli=
citly marked as such like within a subfolder &#39;invalid&#39;.=C2=A0</div>=
<div>Would be helpful to download groups of test files from Maven, like ver=
sions of deliverables as well (but this might be a topic for Maven&#39;s us=
er&#39;s list)...</div><div><br></div><div>Still, I believe I am doing an o=
versight...</div><div><br></div><div>Best regards,</div><div>Svante</div><d=
iv><br></div><div>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 th=
ese lists for software in general... (as you want to users become developer=
s..)</div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gm=
ail_attr">On Wed, 11 Sept 2024 at 15:25, Svante Schubert &lt;<a href=3D"mai=
lto:[email protected]" target=3D"_blank">[email protected]<=
/a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0=
px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><=
div dir=3D"ltr">Dear experts,<div><br></div><div>I am in need of some advic=
e using the <a href=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-tests/src/org/apache/xerces/tests/AllXercesXSD11Tests.java#L=
31" target=3D"_blank">test suite of org.apache.xerces.tests.AllXercesXSD11T=
ests</a> fails for me using my Xerces Jar from a build of=C2=A0<a href=3D"h=
ttps://github.com/apache/xerces-j/tree/xml-schema-1.1-dev" target=3D"_blank=
">Xerces 1.1 GitHub branch</a> and likely I am=C2=A0missing something obvio=
us.</div><div>The error given is &quot;<b><i>sch-props-correct.2: An XSD sc=
hema cannot contain two global components with the same name.</i></b>&quot;=
 and <a href=3D"https://github.com/apache/xerces-j/blob/xml-schema-1.1-test=
s/data/version-control/test37.xsd#L5" target=3D"_blank"><i><b>the test file=
 does have two global 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><d=
iv>What did I miss?</div><div><br></div><div>My steps to do my smoke testin=
g:</div><div><ol><li>As I am not able to easily build &amp; debug with my I=
DEs (like with Maven) using the existing ANT scripts, I generated an easy b=
uild &amp; debug environment for my set of IDEs (Apache Netbeans &amp; Inte=
llij IDEA) represented<a href=3D"https://github.com/svanteschubert/xerces-j=
/commit/7e32264aabbb366360d6a354d2589e1e154fb58f" target=3D"_blank"> by a s=
ingle commit of noise</a>.</li><li>Instead of setting an environment=C2=A0v=
ariable, <a href=3D"https://github.com/svanteschubert/xerces-j/commit/2c50b=
9c6dc88c5394af95d12f6cad9cced822e9e" target=3D"_blank">I hard coded the pat=
h to my tests</a>.<br></li><li>Executed in Netbeans=C2=A0<a href=3D"https:/=
/github.com/apache/xerces-j/blob/xml-schema-1.1-tests/src/org/apache/xerces=
/tests/AllXercesXSD11Tests.java#L31" target=3D"_blank">test suite org.apach=
e.xerces.tests.AllXercesXSD11Tests</a>=C2=A0and getting aside of the above =
so many errors that I must have done something basic wrong.</li></ol></div>=
<div>Thanks for any help!</div><div>Svante</div></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div></div>
</blockquote></div>
</blockquote></div>

--000000000000d164b20622006574--