DocBook v2

Kornel Benko kornel at lyx.org
Wed Sep 2 07:51:35 UTC 2020


Am Wed, 2 Sep 2020 01:02:53 +0200
schrieb Thibaut Cuvelier <tcuvelier at lyx.org>:

> On Tue, 1 Sep 2020 at 16:55, Kornel Benko <kornel at lyx.org> wrote:
> 
> > Am Tue, 1 Sep 2020 10:32:59 -0400
> > schrieb Scott Kostyshak <skostysh at lyx.org>:
> >
> > > On Tue, Sep 01, 2020 at 02:00:18PM +0200, Kornel Benko wrote:
> > >
> > > > This is impressing.
> > >
> > > +1
> > >
> > > Scott
> >
> > These 2 are crashing
> > examples/de/Modules/Linguistics.lyx: assertion
> > templates/Articles/REVTeX_%28V._4.1%29.lyx: assertion
> >
> > Both in src/support/docstring.cpp:53
> >         LATTEST(static_cast<unsigned char>(ascii[i]) < 0x80);
> >
> 
> I did not get a problem on that line with Linguistics.lyx (I did not yet
> have a look at the other file yet), but I suppose it is now fixed. (At
> least, before my last few commits, my code crashed on Windows, and now I
> get an almost perfect DocBook document.) I still have a strange issue
> happening with Linguistics.lyx, but it produces valid XML without
> assertions, so the test should be fixed for now.

No, probably not committed yet.

> I would be interested if you could run the tests with the latest changes :)
> (I did not yet manage to get them running here: since I reconfigured the
> whole project, the test suite seems much shorter…).
> 
> By the way, would it be possible to include validity checks in the test
> suite? That would mean calling a Java library to ensure that the DocBook
> documents follow the specifications (which is a much stronger constraint
> than simply valid XML). Basically, with jing.jar accessible in the Java
> path (https://relaxng.org/jclark/jing.html), it would just mean that
> command for each file.xml:

But we have these validity checks ... these are the xmllint and perl with XML::Parser

> java -jar jing.jar docbook.rng file.xml
> 
> docbook.rng comes from https://docbook.org/xml/5.2b09/rng/ (latest version
> right now). There are other implementations than Jing, like
> https://github.com/tlocke/prang in Python and
> https://metacpan.org/pod/distribution/XML-LibXML/lib/XML/LibXML/RelaxNG.pod
> in Perl. The latter reuses existing Perl dependencies (libxml2), but I have
> no idea of the quality of that implementation (Jing is really the
> reference).

Good idea. But ...
 $   jing.jar docbook.rng ...
Error: Unable to access jarfile jing.jar

The file jing.jar is installed as  , but java does not even try to
access /usr/share.

Selecting the full path, I get
 $ java -jar/usr/share/java/jing.jar docbook.rng ...
fatal: file not found: .../docbook.rng

OK, replacing docbook.rng with /usr/share/xml/docbook/schema/rng/5.0/docbook.rng

I get now for instance:
 $ java
 -jar /usr/share/java/jing.jar /usr/share/xml/docbook/schema/rng/5.0/docbook.rng ./autotests/out-home/templates/Letters/DIN-Brief.xml
... ./autotests/out-home/templates/Letters/DIN-Brief.xml:5:12: fatal: Attribute name
"Address" associated with an element type "My" must be followed by the ' = ' character.
Exit 1

Apparently this jing.jar or docbook.rng do not like elements containing spaces ...

So the question is: Where can we get suitable jar/rng files for test?

	Kornel






-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: Digitale Signatur von OpenPGP
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20200902/e076f715/attachment-0001.asc>


More information about the lyx-devel mailing list