Re: Re: Possible Bug: Xerces 2.12.1 for XML Validation with XSD 1.1 Schema under Java - Plain Text
Mukul Gandhi <[email protected]> Sun, 23 Aug 2020 15:13:15 +0530
| Newsgroups | gmane.text.xml.xerces-j.user |
|---|---|
| Message-ID | <CABuuzNNEFCYGhVLQAhuOsZ+Hh1v-8vT4HTGoe_yr66vitRUs_w@mail.gmail.com> |
--000000000000a22e2a05ad884d18 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Aug 23, 2020 at 2:13 PM JOHN Morris <[email protected]= d> wrote: > I think that the first steps in achieving convergence between the > validation behaviour that you observe and mine is for me to try switching > to jaxp.SourceValidator and to ensure that I am using the same environmen= t > as you. To that (second) end, I would ask you to provide a (Windows) batc= h > file, embodying the environment that you use to run your tests (unless yo= ur > tests were made using the environment in my batch file). > Following are the contents of batch file that I use, to run XSD 1.1 validation using Xerces-J sample jaxp.SourceValidator, *@echo off* *java -Djava.endorsed.dirs=3DF:\xerces-2_12_1-xml-schema-1.1 jaxp.SourceValidator -i %1 -a %2 -f -fx -xsd11* (please replace F:\xerces-2_12_1-xml-schema-1.1 with Xerces-J's path on your environment) The above batch file needs to be invoked as: <batch_file_name> xmlFile_name xsdFile_name I'm currently using java 1.8.0_241 from Oracle. > I would also ask you which characters in my XML files were unable to be > represented in the default UTF-8 encoding, in case they are the result > typos that I haven't noticed. > When I specify the XML prolog as <?xml version=3D"1.0"?>, for the XML document that is validated, I get following errors, [Fatal Error] test1.xml:10:93: Invalid byte 2 of 3-byte UTF-8 sequence. (that is the line <copyright>Copyright (C) 2005 - 2017 joomla.fr et Open Source Matters. Tous droits r=C3=A9serv=C3=A9s</copyright> within your XML = document) Specifying the XML prolog as <?xml version=3D"1.0" encoding=3D"ISO-8859-1"?= >, solves this problem for me. --=20 Regards, Mukul Gandhi --000000000000a22e2a05ad884d18 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div di= r=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"lt= r">On Sun, Aug 23, 2020 at 2:13 PM JOHN Morris <[email protected].= invalid> wrote:<br></div><div class=3D"gmail_quote"><blockquote class=3D= "gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(2= 04,204,204);padding-left:1ex"><div><p>I think that the first steps in achie= ving convergence between the validation behaviour that you observe and mine= is for me to try switching to jaxp.SourceValidator and to ensure that I am= using the same environment as you. To that (second) end, I would ask you t= o provide a (Windows) batch file, embodying the environment that you use to= run your tests (unless your tests were made using the environment in my ba= tch file).<br></p></div></blockquote><div>Following are the contents of bat= ch file that I use, to run XSD 1.1 validation using Xerces-J sample jaxp.So= urceValidator,</div><div><br></div><div><div><i>@echo off</i></div><div><i>= <br></i></div><div><i>java -Djava.endorsed.dirs=3DF:\xerces-2_12_1-xml-sche= ma-1.1 jaxp.SourceValidator -i %1 -a %2 -f -fx -xsd11</i></div></div><div><= br></div><div>(please replace=C2=A0F:\xerces-2_12_1-xml-schema-1.1 with Xer= ces-J's path on your environment)</div><div><br></div><div>The above ba= tch file needs to be invoked as: <batch_file_name> xmlFile_name xsdFi= le_name</div><div><br></div><div>I'm currently using java 1.8.0_241 fro= m Oracle.</div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0p= x 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><p></= p><p>I would also ask you which characters in my XML files were unable to b= e represented in the default UTF-8 encoding, in case they are the result ty= pos that I haven't noticed.</p></div></blockquote><div>When I specify t= he XML prolog as=C2=A0<?xml version=3D"1.0"?>, for the XML = document that is validated, I get following errors,</div><div><br></div><di= v>[Fatal Error] test1.xml:10:93: Invalid byte 2 of 3-byte UTF-8 sequence.<b= r></div><div><br></div><div>(that is the line=C2=A0<copyright>Copyrig= ht (C) 2005 - 2017 <a href=3D"http://joomla.fr">joomla.fr</a> et Open Sourc= e Matters. Tous droits r=C3=A9serv=C3=A9s</copyright> within your XML= document)</div><div><br></div><div>Specifying the XML prolog as=C2=A0<?= xml version=3D"1.0" encoding=3D"ISO-8859-1"?>, solve= s this problem for me.</div><div>=C2=A0</div></div><br clear=3D"all"><div><= br></div>-- <br><div dir=3D"ltr" class=3D"gmail_signature"><div dir=3D"ltr"= ><div>Regards,<br>Mukul Gandhi<br></div></div></div></div></div></div></div= ></div></div></div></div> --000000000000a22e2a05ad884d18--