Groups | Search | Server Info | Login | Register


Groups > comp.text.xml > #900

Re: Schematron questions

From "N. Raghavendra" <nyraghu27132@gmail.com>
Newsgroups comp.text.xml
Subject Re: Schematron questions
References (4 earlier) <fm6br2Fs67sU1@mid.individual.net> <87vabltltf.fsf@gmail.com> <fm8pg0Fdrn9U1@mid.individual.net> <87o9hcuucq.fsf@gmail.com> <fme7s4Fjlm8U1@mid.individual.net>
Message-ID <87y3gdsof3.fsf@gmail.com> (permalink)
Organization usenet-news.net
Date 2018-05-21 08:30 +0530

Show all headers | View raw


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 ----------

Back to comp.text.xml | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Schematron questions "N. Raghavendra" <raghu@hri.res.in> - 2018-05-11 12:58 +0530
  Re: Schematron questions "N. Raghavendra" <nyraghu27132@gmail.com> - 2018-05-11 13:44 +0530
  Re: Schematron questions "N. Raghavendra" <nyraghu27132@gmail.com> - 2018-05-12 13:43 +0530
  Re: Schematron questions George Bina <george@oxygenxml.com> - 2018-05-14 06:52 -0700
    Re: Schematron questions "N. Raghavendra" <nyraghu27132@gmail.com> - 2018-05-14 20:46 +0530
      Re: Schematron questions "N. Raghavendra" <nyraghu27132@gmail.com> - 2018-05-14 21:24 +0530
        Re: Schematron questions Peter Flynn <peter@silmaril.ie> - 2018-05-17 22:51 +0100
          Re: Schematron questions "N. Raghavendra" <nyraghu27132@gmail.com> - 2018-05-18 13:52 +0530
            Re: Schematron questions Manuel Collado <m-collado@users.sourceforge.net> - 2018-05-18 15:39 +0200
              Re: Schematron questions "N. Raghavendra" <nyraghu27132@gmail.com> - 2018-05-18 20:40 +0530
            Re: Schematron questions Peter Flynn <peter@silmaril.ie> - 2018-05-18 20:56 +0100
              Re: Schematron questions "N. Raghavendra" <nyraghu27132@gmail.com> - 2018-05-19 10:15 +0530
                Re: Schematron questions Peter Flynn <peter@silmaril.ie> - 2018-05-20 22:32 +0100
                Re: Schematron questions "N. Raghavendra" <nyraghu27132@gmail.com> - 2018-05-21 08:30 +0530
                Re: Schematron questions Peter Flynn <peter@silmaril.ie> - 2018-06-29 22:32 +0100
                Re: Schematron questions "N. Raghavendra" <nyraghu27132@gmail.com> - 2018-07-01 00:24 +0530

csiph-web