OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook] xi:include problem


On 2013-12-10 06:47, Shaun McCance wrote:
On Tue, 2013-12-10 at 00:38 -0800, Alex Kleider wrote:
On 2013-12-09 22:55, davep wrote:

> Jing is a validating parser, it knows nothing of xinclude.
> Use a tool to expand the xincludes prior to processing (validation and
> transformation).
>
> HTH

Thanks for the tip.  I did some searching and found xmlstarlet but it
seems not to want to deal with RELAX NG:
"""
alex@x301:~/Docbook/Opus$ xmlstarlet tr --xinclude
/usr/share/xml/docbook/schema/rng/5.0/docbook.rng main.xml
compilation error: file
/usr/share/xml/docbook/schema/rng/5.0/docbook.rng line 2 element grammar
xsltParseStylesheetProcess : document is not a stylesheet
"""
A little more poking around and I came up with
$ xmlstarlet tr --xinclude
/usr/share/xml/docbook/stylesheet/docbook5/db4-upgrade.xsl dreamplug.xml
 > dream.xml
which when followed by
$ jing /usr/share/xml/docbook/schema/rng/5.0/docbook.rng dream.xml
all seems to work fine.

I don't quite understand why a program that expands xincludes would
want/need a style sheet.
I would have thought that one wouldn't be necessary until the next step
after validation:
$ xmlto --skip-validation html dream.xml
although xmlt never seems to complain at not having one.  I've assumed
it was using a default.

xmlstarlet is not just a program for expanding XIncludes. You passed it
the 'tr' command, which is for applying XSLT. If you want to validate
against a schema and do XInclude processing, use xmllint, which will
happily handle both XIncude and RNG for you:

xmllint --xinclude --noout
--relaxng /usr/share/xml/docbook/schema/rng/5.0/docbook.rng dream.xml

--
Shaun

Thanks, Shaun, for taking an interest.
On my (Ubuntu 12.4) system,
apt-cache search xmllint =>
libxml2-utils - XML utilities
bluefish - advanced Gtk+ HTML editor

Googling xmllint tells me that "It is included in libxml2."
A little more time with the man page should get me up to speed.

I very much appreciate the tip.
cheers,
alex


is xmllint part of libxml2-utils?

Also, in your call to xmllint, what does the noout parameter signify and where do you specify the source file?
(I'm sure I could figure all of this out if I could find

alex
~



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]