Re: few Xerces-J XSD 1.1 validation performance measurements
"Eric J. Schwarzenbach" <[email protected]> Tue, 27 Apr 2021 13:05:43 -0400
| Newsgroups | gmane.text.xml.xerces-j.user |
|---|---|
| Message-ID | <[email protected]> |
--------------7EFA7FD23437F56CBA03758A
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Thank you. It seems as though this information should be provided on
this page, as well as on the downloads page. I'd like to post a bug
about this, as well as a few related items that seem to make it
surprisingly difficult to know what you are getting wrt schema 1.1
support, but I'd like to make sure I understand the full situation. BTW
in browsing the bug database, I see your name all over the schema 1.1
issues, Mukul, and I'd like to thank you for all the work you've done to
get Schema support in xerces-j to what it is.
Among the things I've noticed is that "regular" xerces impl is quite
happy to validate XML files referencing 1.1 schemas (i.e. which have
vc:minVersion="1.1"). It may be arguable about whether this is correct
if the XML being validated does not use any 1.1 features, but that could
be discussed in the issue comments if I post an issue.
But maybe the first questions I should ask is why is there a "regular"
variant of xerces which does not support 1.1 in the first place? What
advantage does it have over the schema 1.1 variant? Is the 1.1 variant
considered "not quite ready for prime time"?
I'd also note that the jar in the maven central repository seems to be
the "regular" version and there is no schema 1.1 variant there.
To test out the oddity of the "regular" variant happily validating files
referencing these 1.1 schemas, I added an attribute of
type="xs:dateTimeStamp" to an element definition and tried validating an
XML file using this instance. (I am not sure whether these schemas
actually already used any 1.1 specific features.) And sure enough the
regular variant did respond with an error ("Error resolving component
'xs:dateTimeStamp'. It was detected that 'xs:dateTimeStamp' is in
namespace 'http://www.w3.org/2001/XMLSchema', but components from this
namespace are not referenceable from schema document..." etc.)
I swapped in the "Schema 1.1" variant of xercesImpl.jar, and tried
validating again, and I get the error:
cvc-elt.1.a: Cannot find the declaration of element 'module'.
(module is the root element of the document)
The Oxygen editor considers it valid. I get this same error from the
schema 1.1 xerces variant trying to validate any of my xml files, even
after reverting any changed from my xs:dateTimeStamp experiment. It
would seem that it breaks something that works with the regular variant.
The way I am invoking validation here, is (for convenience) via one of
the xercesSamples classes. Essentially I'm calling
java -cp
.:./lib/xml-apis-1.4.01.jar:./lib/xercesImpl-2.12.1.jar:./lib/xercesSamples-2.12.1.jar
sax.Counter -np -n -v -s "$1"
The xml files reference the schema via xsi:schemaLocation which
references the schema via an http url.
Is there any reason to expect this not to work with the schema 1.1 variant?
Thanks,
Eric
On 4/27/21 3:54 AM, Mukul Gandhi wrote:
> On Tue, Apr 27, 2021 at 12:13 AM Eric Schwarzenbach
> <[email protected] <mailto:[email protected]>>
> wrote:
>
> Is there any place on the xerces site that explains the difference
> between the "Xerces2 Java 2.12.1" and "Xerces2 Java 2.12.1 (XML
> Schema 1.1)" downloads? It seems like various places on the site
> it just say it support Schema 1.1. Is that only if you use the
> "Xerces2 Java 2.12.1 (XML Schema 1.1)" version of the xerces impl jar?
>
> The download "Xerces2 Java 2.12.1 (XML Schema 1.1)" mentioned on the
> Xerces site, supports all the features listed at
> http://xerces.apache.org/xerces2-j/ 'Features of This Release'.
>
> Whereas, the download "Xerces2 Java 2.12.1" mentioned on the Xerces
> site, supports all the features listed at
> http://xerces.apache.org/xerces2-j/ 'Features of This Release'
> excluding the last two (i.e 'XML Schema 1.1 Structures and Datatypes
> Recommendations' & 'XML Schema Definition Language (XSD): Component
> Designators (SCD) Candidate Recommendation (January 2010)' are not
> provided by "Xerces2 Java 2.12.1").
>
>
>
> --
> Regards,
> Mukul Gandhi
--------------7EFA7FD23437F56CBA03758A
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 8bit
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Thank you. It seems as though this information should be provided
on this page, as well as on the downloads page. I'd like to post a
bug about this, as well as a few related items that seem to make
it surprisingly difficult to know what you are getting wrt schema
1.1 support, but I'd like to make sure I understand the full
situation. BTW in browsing the bug database, I see your name all
over the schema 1.1 issues, Mukul, and I'd like to thank you for
all the work you've done to get Schema support in xerces-j to what
it is.</p>
<p>Among the things I've noticed is that "regular" xerces impl is
quite happy to validate XML files referencing 1.1 schemas (i.e.
which have vc:minVersion="1.1"). It may be arguable about whether
this is correct if the XML being validated does not use any 1.1
features, but that could be discussed in the issue comments if I
post an issue.</p>
<p>But maybe the first questions I should ask is why is there a
"regular" variant of xerces which does not support 1.1 in the
first place? What advantage does it have over the schema 1.1
variant? Is the 1.1 variant considered "not quite ready for prime
time"? <br>
</p>
<p>I'd also note that the jar in the maven central repository seems
to be the "regular" version and there is no schema 1.1 variant
there.<br>
</p>
<p>To test out the oddity of the "regular" variant happily
validating files referencing these 1.1 schemas, I added an
attribute of type="xs:dateTimeStamp" to an element definition and
tried validating an XML file using this instance. (I am not sure
whether these schemas actually already used any 1.1 specific
features.) And sure enough the regular variant did respond with an
error ("Error resolving component 'xs:dateTimeStamp'. It was
detected that 'xs:dateTimeStamp' is in namespace
'<a class="moz-txt-link-freetext" href="http://www.w3.org/2001/XMLSchema">http://www.w3.org/2001/XMLSchema</a>', but components from this
namespace are not referenceable from schema document..." etc.)</p>
<p>I swapped in the "Schema 1.1" variant of xercesImpl.jar, and
tried validating again, and I get the error: <br>
</p>
<p>cvc-elt.1.a: Cannot find the declaration of element 'module'.<br>
</p>
<p>(module is the root element of the document)<br>
</p>
<p>The Oxygen editor considers it valid. I get this same error from
the schema 1.1 xerces variant trying to validate any of my xml
files, even after reverting any changed from my xs:dateTimeStamp
experiment. It would seem that it breaks something that works with
the regular variant.<br>
</p>
<p>The way I am invoking validation here, is (for convenience) via
one of the xercesSamples classes. Essentially I'm calling</p>
<p>java -cp
.:./lib/xml-apis-1.4.01.jar:./lib/xercesImpl-2.12.1.jar:./lib/xercesSamples-2.12.1.jar
sax.Counter -np -n -v -s "$1"</p>
<p>The xml files reference the schema via xsi:schemaLocation which
references the schema via an http url. <br>
</p>
<p>Is there any reason to expect this not to work with the schema
1.1 variant?<br>
</p>
<p>Thanks,</p>
<p>Eric<br>
</p>
<p><br>
</p>
<div class="moz-cite-prefix">On 4/27/21 3:54 AM, Mukul Gandhi wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CABuuzNOEFu+C34TWYh8OTsy8tGrZ6qZrFL8hzY8RK2phS+_tvg@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div dir="ltr">On Tue, Apr 27, 2021 at 12:13 AM Eric
Schwarzenbach <<a
href="mailto:[email protected]"
moz-do-not-send="true">[email protected]</a>>
wrote:</div>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div>
<p>Is there any place on the xerces site that explains the
difference between the "Xerces2 Java 2.12.1" and
"Xerces2 Java 2.12.1 (XML Schema 1.1)" downloads? It
seems like various places on the site it just say it
support Schema 1.1. Is that only if you use the "Xerces2
Java 2.12.1 (XML Schema 1.1)" version of the xerces impl
jar?</p>
</div>
</blockquote>
<div>The download
"Xerces2 Java 2.12.1 (XML Schema 1.1)" mentioned on the
Xerces site, supports all the features listed at <a
href="http://xerces.apache.org/xerces2-j/"
moz-do-not-send="true">http://xerces.apache.org/xerces2-j/</a>
'Features of This Release'.</div>
<div><br>
</div>
<div>Whereas, the download
"Xerces2 Java 2.12.1" mentioned on the Xerces site,
supports all the features listed at <a
href="http://xerces.apache.org/xerces2-j/"
moz-do-not-send="true">http://xerces.apache.org/xerces2-j/</a>
'Features of This Release' excluding the last two (i.e 'XML
Schema 1.1 Structures and Datatypes Recommendations' &
'XML Schema Definition Language (XSD): Component Designators
(SCD) Candidate Recommendation (January 2010)' are not
provided by "Xerces2 Java 2.12.1").</div>
<div><br>
</div>
<div><br>
</div>
</div>
<div><br>
</div>
-- <br>
<div dir="ltr" class="gmail_signature"
data-smartmail="gmail_signature">
<div dir="ltr">
<div>Regards,<br>
Mukul Gandhi<br>
</div>
</div>
</div>
</div>
</blockquote>
</body>
</html>
--------------7EFA7FD23437F56CBA03758A--