Re: Java Heap Space problems with XSD 1.1 validation, asserts and large files

Mukul Gandhi <[email protected]> Sat, 3 Apr 2021 14:56:00 +0530
Newsgroups gmane.text.xml.xerces-j.user
Message-ID <CABuuzNN7+02XWXvBrhUOrPkopvsrznHY1F_kGsrx8hC78OVfdA@mail.gmail.com>
--00000000000074dc5b05bf0e0eb8
Content-Type: text/plain; charset="UTF-8"

On Tue, Mar 30, 2021 at 1:13 PM Zimmel, Daniel <[email protected]>
wrote:

> Duplicating the tree does indeed explain a lot
>

I don't think that, Xerces XSD 1.1 <assert> implementation duplicates
creating XML fragment trees. The main validation logic for Xerces XSD 1.1 &
1.0 implementations occurs in a streaming fashion (its termed XNI [xerces
native interface] within Xerces, which is similar to XML SAX events). Only
when <assert> are encountered during XSD 1.1 validation processing, Xerces
builds DOM tree and hands it over to the XPath 2.0 engine. The Eclipse
XPath 2.0 engine (over which Xerces XSD 1.1 <assert> implementation is
based upon, and is a third party dependency for Xerces XSD 1.1
implementation), requires the XDM (XPath data model) tree to be constructed
as a DOM tree.


> In general I always feel that XSD 1.1 adoption (and using assertions) is
> not that widespread when I talk to other XML users/devs so I can understand
> the incentive for improving this are quite non-existent.
>

IMHO, I differ with you somewhat on this point.

The latest specs for XSLT (3.0), XQuery (3.1) and XPath (3.1) mention that,
implementors of these languages can use either XSD 1.0 or 1.1 (this aspect
is implementation defined) as a language for their type system. This I
think emphasizes the importance of XSD 1.1 within the main XML based
standards.

The XSD 1.1 language has lots of new features (other than <assert>) as
compared to XSD 1.0, which are significant improvement over XSD 1.0, and
certainly it shall be prudent that XSD 1.0 users should consider adopting
XSD 1.1.



-- 
Regards,
Mukul Gandhi

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

<div dir=3D"ltr"><div dir=3D"ltr">On Tue, Mar 30, 2021 at 1:13 PM Zimmel, D=
aniel &lt;<a href=3D"mailto:[email protected]">[email protected]</a=
>&gt; 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(204,204=
,204);padding-left:1ex">





<div lang=3D"DE">
<div class=3D"gmail-m_6430956049721150082WordSection1">
<p class=3D"MsoNormal">Duplicating the tree does indeed explain a lot<br></=
p></div></div></blockquote><div><br></div><div>I don&#39;t think that, Xerc=
es XSD 1.1 &lt;assert&gt; implementation duplicates creating XML fragment t=
rees. The main validation logic for Xerces XSD 1.1 &amp; 1.0 implementation=
s occurs in a streaming fashion (its termed XNI [xerces native interface] w=
ithin Xerces, which is similar to XML SAX events). Only when &lt;assert&gt;=
 are encountered during XSD 1.1 validation processing, Xerces builds DOM tr=
ee and hands it over to the XPath 2.0 engine. The Eclipse XPath 2.0 engine =
(over which Xerces XSD 1.1 &lt;assert&gt; implementation is based upon, and=
 is a third party dependency for Xerces XSD 1.1 implementation), requires t=
he XDM (XPath data model) tree to be constructed as a DOM tree.</div><div>=
=C2=A0</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"><div lang=3D"=
DE"><div class=3D"gmail-m_6430956049721150082WordSection1">
<p class=3D"MsoNormal"><span lang=3D"EN-GB">In general I always feel that X=
SD 1.1 adoption (and using assertions) is not that widespread when I talk t=
o other XML users/devs so I can understand the incentive for improving this
 are quite non-existent.</span></p></div></div></blockquote><div><br></div>=
<div>IMHO, I differ with you somewhat on this point.</div><div><br></div><d=
iv>The latest specs for XSLT (3.0), XQuery (3.1) and XPath (3.1) mention th=
at, implementors=C2=A0of these languages can use either XSD 1.0 or 1.1 (thi=
s aspect is implementation defined) as a language for their type system. Th=
is I think emphasizes the importance of XSD 1.1 within the main XML based s=
tandards.</div><div><br></div><div>The XSD 1.1 language has lots of new fea=
tures (other than &lt;assert&gt;) as compared to XSD 1.0, which are signifi=
cant=C2=A0improvement over XSD 1.0, and certainly it shall be prudent that =
XSD 1.0 users should consider adopting XSD 1.1.</div><div><br></div><div>=
=C2=A0</div></div><div><br></div>-- <br><div dir=3D"ltr" class=3D"gmail_sig=
nature"><div dir=3D"ltr"><div>Regards,<br>Mukul Gandhi<br></div></div></div=
></div>

--00000000000074dc5b05bf0e0eb8--