Path: csiph.com!news.mixmin.net!news.unit0.net!border1.nntp.ams1.giganews.com!nntp.giganews.com!newsfeed.xs4all.nl!newsfeed9.news.xs4all.nl!85.12.16.68.MISMATCH!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.am4!peer.am4.highwinds-media.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!post02.iad!fx35.iad.POSTED!not-for-mail From: "N. Raghavendra" Newsgroups: comp.text.xml Subject: Re: Schematron questions References: <87vabuodmk.fsf@hri.res.in> <871see5kta.fsf@gmail.com> <87sh6u44hh.fsf@gmail.com> <87vabltltf.fsf@gmail.com> <87o9hcuucq.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Reply-To: "N. Raghavendra" Message-ID: <87y3gdsof3.fsf@gmail.com> Cancel-Lock: sha1:eyPNgCooNNgC0mHlQ+PS4IaxXDU= MIME-Version: 1.0 Content-Type: text/plain Lines: 148 X-Complaints-To: abuse@usenet-news.net NNTP-Posting-Date: Mon, 21 May 2018 03:00:49 UTC Organization: usenet-news.net Date: Mon, 21 May 2018 08:30:48 +0530 X-Received-Bytes: 5894 X-Received-Body-CRC: 2587025083 X-Original-Bytes: 5711 Xref: csiph.com comp.text.xml:900 At 2018-05-20T22:32:52+01:00, Peter Flynn wrote: > I haven't used LaTeX for authoring since the early 90s: everything has > been in SGML and then XML, and transformed to LaTeX for formatting, so > its lack of formal structure has not concerned me: it's basically an API > to create PDFs. I indeed like the phrase "an API to create PDFs"! I wish I knew, in the 90s, someone who could tell me that. >> I have some experience with DocBook, but, for my current purpose, it >> has too many elements that are irrelevant. > > You can remove the bits you don't want from the RNG and recreate a new > DTD or Schema. I just ignore them, as I never see them. I have made a first attempt at extending the RNC, which seemed easier than extending the RNG. The resulting schema, which I've called `mono.rnc' is deemed valid by `jing': $ jing -c mono.rnc && echo "VALID" VALID I am also able to convert the RNC to an RNG with trang: $ trang mono.rnc mono.rng && echo "SUCCESS" SUCCESS Now, to use PSGML, I have to convert the RNC to a DTD. However, when I try to do that with `trang', the command aborts with several errors: $ trang mono.rnc mono.dtd /home/raghu/xml/xml/mono.rnc:14:1: error: sorry, combining definitions with combine="choice" is not supported /pkg/docbook/rng/docbookxi.rnc:264:6: error: sorry, ambiguous attribute choice not handled (attribute "type" from namespace "http://www.w3.org/1999/xlink") [...] I have enclosed the schema `mono.rnc' below. I would be grateful if you have any suggestions. > I'd still look at modifying DocBook by removing the bits you don't > need and writing the new bits along the same lines before making that > rather final decision. At least that way you benefit from nearly 30 > years of development experience... The profound experience and expertise that are behind DocBook certainly make it very attractive. That is the reason I prefer it to PreTeXt, although the semantics of the latter are, in some ways, closer to what I am seeking. > Either way, please bear in mind that the organisers of the Balisage > conference, the MarkupUK conference, and the assorted TUG conferences > would always be interested in a paper describing what you have done, > once its done (or at least, under way). I would be glad to report on my efforts if they are successful. Thanks again for all the advice and help. Raghu. PS: Here is my first attempt at an RNC. ---------- mono.rnc ---------- # The namespace for all unqualified names. We use the prefix `db' for # it. default namespace db = "http://docbook.org/ns/docbook" ## Include the DocBook schema which allows XInclude. include "/pkg/docbook/rng/docbookxi.rnc" ## Add a new choice pattern `db.statement.blocks' to the pattern ## `db.formal.blocks'. This makes the `db.statement.blocks' pattern a ## valid option in any context where `db.formal.blocks' appears. db.formal.blocks |= db.statement.blocks ## The `db.statement.blocks' pattern is itself a choice pattern, whose ## values are the patterns that match definitions, theorems, etc. db.statement.blocks = db.corollary | db.definition | db.lemma | db.notation | db.observation | db.proposition | db.theorem ## Here is the definition of the individual values of the ## `db.statement.blocks' choice pattern. div { db.corollary = element corollary { db._statement.content } db.definition = element definition { db._statement.content } db.lemma = element lemma { db._statement.content } db.notation = element notation { db._statement.content } db.observation = element observation { db._statement.content } db.proposition = element proposition { db._statement.content } db.theorem = element theorem { db._statement.content } } ## The content of an individual value of the `db.statement.blocks' ## choice pattern. Adapted from `db.example'. div { db._statement.content = db._statement.attlist , db._statement.info , db.all.blocks + , db.caption ? db._statement.attlist = db._statement.role.attribute ? & db.common.attributes & db.common.linking.attributes & db._statement.label.attribute ? & db._statement.floatstyle.attribute ? & ( db._statement.width.attribute | db._statement.pgwide.attribute ) ? db._statement.info = db._info.title.onlyreq db._statement.role.attribute = attribute role { text } db._statement.label.attribute = db.label.attribute db._statement.floatstyle.attribute = db.floatstyle.attribute db._statement.width.attribute = db.width.characters.attribute db._statement.pgwide.attribute = db.pgwide.attribute } ---------- mono.rnc ends here ----------