lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] Why should we sort XML documents? (was: Remarkable performance


From: Vadim Zeitlin
Subject: Re: [lmi] Why should we sort XML documents? (was: Remarkable performance problem)
Date: Sun, 4 Mar 2018 23:35:18 +0100

[I'm leaving aside the happy news about the original problem having
 disappeared on its own with Wine 3 and starting a subthread for a
 tangential, yet still worth discussing IMHO, question of avoiding
 sorting the XML documents unnecessarily]

On Sun, 4 Mar 2018 01:15:34 +0000 Greg Chicares <address@hidden> wrote:

GC> On 2018-03-04 00:38, Vadim Zeitlin wrote:
GC> > On Fri, 2 Mar 2018 17:42:58 +0000 Greg Chicares <address@hidden> wrote:
GC> > GC> Sorting is necessary only if XSD validation requires it.
[...]
GC> >  I think it does, but this would be easy to fix if it's not desired: we
GC> > need to use "interleave", which is represented by "&" in Relax NG compact
GC> > syntax that we use.
GC> [...]
GC> > I don't include the patch for this change because I didn't have the time 
to
GC> > test it yet, but I'm relatively sure it ought to work.
GC>
GC> I don't think that change will be wanted:
GC> 
GC> - IIRC, "interleave" doesn't let us diagnose missing elements well.

 No, sorry, this doesn't seem to be correct. Replacing commas with
ampersands in multiple_cell_document.rnc or, alternatively, replacing
xs:sequence with xs:all in multiple_cell_document.xsd, still results in the
expected error when validating sample.cns after removing case_default tag
from it:

- With jing and RNC I get

sample.cns:399:26: error: element "multiple_cell_document" incomplete; missing 
required element "case_default"

  which is just as good as the current error

sample.cns:3:19: error: element "class_defaults" not allowed yet; missing 
required element "case_default"

- With jing and XSD I get

sample.cns:399:26: error: 
http://www.w3.org/TR/xml-schema-1#cvc-complex-type.2.4.b?multiple_cell_document&{case_default}

  which is not very clear because the URI doesn't work any more, but the
  same is true of the current message, which is almost the same (it uses
  2.4.a instead of 2.4.b) anyhow.

- And with xmllint and XSD I get

sample.cns:2: element multiple_cell_document: Schemas validity error : Element 
'multiple_cell_document': Missing child element(s). Expected is ( case_default 
).

  which looks perfectly good too.


GC> - See the "Primary...Secondary...Tertiary" comments in 'test_schemata.sh'.

 Sorry, I'm not sure which part of this comment was supposed to apply to
the current thread. I was (and now am even more) aware that we generate XSD
from RNC, but why should it be a problem?


GC> - Validation has to be built into lmi. I'm not willing to have it
GC>   depend on "java". In light of the commentary referenced in the
GC>   preceding point, that means we have to use XSD, not RNC or RNG.

 Yes, sure, but XSD is generated from RNC and stored in the repository, so
what's the problem? We could modify the XSD directly too, of course, the
change is trivial (s/sequence/all/ as mentioned above), but why would we do
this?

GC> > But I still think that it would be better to avoid sorting
GC> > unnecessarily in any case, even if it's completely unrelated to the
GC> > problem at hand.
GC> Can't--see above.

 Sorry, but I don't see at all why can't we do what I proposed. Please let
me know what am I missing if it's not too much trouble.

 Thanks in advance,
VZ


reply via email to

[Prev in Thread] Current Thread [Next in Thread]