What are the available tools for validating against RELAX NG with
embedded Schematron rules, and against pure Schematron schema?
I am trying to construct an XML schema for a mathematics monograph.
RELAX NG seems to be a canonical choice for a schema language, but I am wondering if it is possible to do this with only Schematron.
Is it possible to define a schema with just Schematron?
Another question I have is about validation of XML documents against Schematron schema.
What are the available tools for validating against RELAX NG with
embedded Schematron rules, and against pure Schematron schema?
Thanks and best regards,
Raghu.
I am trying to construct an XML schema for a mathematics monograph.
RELAX NG seems to be a canonical choice for a schema language, but I am wondering if it is possible to do this with only Schematron.
Is it possible to define a schema with just Schematron?
Another question I have is about validation of XML documents against Schematron schema.
What are the available tools for validating against RELAX NG with
embedded Schematron rules, and against pure Schematron schema?
Thanks and best regards,
Raghu.
However, there are no tools that will provide you guided editing based
on the Schematron schema, like for example showing you what elements
are possible at some point in the document when you are editing.
Look also at http://www.schematron.com for Schematron related
information.
At 2018-05-14T06:52:04-07:00, George Bina wrote:
However, there are no tools that will provide you guided editing based
on the Schematron schema, like for example showing you what elements
are possible at some point in the document when you are editing.
Thank you for your reply.
I found RELAX NG Compact Syntax schema for Schematron at
https://github.com/Schematron/schema
The nXML mode of Emacs provides schema-sensitive editing using RELAX NG Compact Syntax. So, it should be possible to use the above in Emacs,
and get completion for allowed element names, etc.
At 2018-05-14T20:46:49+05:30, N. Raghavendra wrote:
At 2018-05-14T06:52:04-07:00, George Bina wrote:
However, there are no tools that will provide you guided editing based
on the Schematron schema, like for example showing you what elements
are possible at some point in the document when you are editing.
Thank you for your reply.
I found RELAX NG Compact Syntax schema for Schematron at
https://github.com/Schematron/schema
The nXML mode of Emacs provides schema-sensitive editing using RELAX NG
Compact Syntax. So, it should be possible to use the above in Emacs,
and get completion for allowed element names, etc.
I think I misunderstood your statement. With what I said, I can only
edit a Schematron schema in nXML mode. nXML mode won't provide me context-sensitive completion, etc., for editing a document that is an instance of that schema.
I have been trying to make it clear for some time that nXML is *not* an editor suitable for writing XML documents.
What you want is psgml, which has the full set of document-editing
features (completion, insertion, encapsulation, deletion, change,
splitting, attribute editing, etc). Install it from your Emacs repos (I
think it's in marmelade).
There is a separate xxml-mode.el which provides even more editing
features.
But psgml only works with DTDs (XML DTDs as well as SGML DTDs) as it has
no knowledge of RNG or W3C schemas. This is usually not a problem for
the document-world (books, journals, articles), where RNG/W3C are rarely
used yet.
When I win the Lottery I will fund an elisp expert to modify psgml
a) to support RNG/W3C;
b) to add a few features like element-join; and
c) merge the features of xxml-mode and fix a few trivial buglets.
Unless some valiant elisp hacker cares to step up to the plate...
...
If one wants to publish a book with a commercial publisher, one may have
to use a DTD. However, I am planning to release my work under a
combination of the Gnu FDL and the GNU GPL, so I will have to take care
of the publishing myself, whatever "publishing" may mean here (it will certainly include putting the product on a public Web site). Given
that, I have considered two schemas, the DocBook schema, and the
`mathbook' schema (http://mathbook.pugetsound.edu/). Both of them use
RELAX NG as their primary schema language. However, neither of these
schemas really suits my needs, so I am trying to write a simple schema
that will do for me.
You may want to try XXE: http://www.xmlmind.com/xmleditor/. It is a commercial product, but there is a free personal edition.
It is a validating structure editor, not a text editor. And probably
the best DocBook editor.
At 2018-05-17T22:51:30+01:00, Peter Flynn wrote:[...]
I have been trying to make it clear for some time that nXML is *not* an
editor suitable for writing XML documents.
Well, it is a part of Emacs, and I have read good things about it, as in
Therefore, I thought it was reasonable to use it for editing XML.
If one wants to publish a book with a commercial publisher, one may have
to use a DTD.
However, I am planning to release my work under a combination of theThat's very generous of you.
Gnu FDL and the GNU GPL, so I will have to take care of the
publishing myself, whatever "publishing" may mean here (it will
certainly include putting the product on a public Web site).
Given that, I have considered two schemas, the DocBook schema, and
the `mathbook' schema (http://mathbook.pugetsound.edu/). Both of them
use RELAX NG as their primary schema language. However, neither of
these schemas really suits my needs, so I am trying to write a simple
schema that will do for me.
Where do vocabularies come from?
• Adopt — Take your pick: XHTML, DocBook, JATS, TEI, DITA, …
• Adapt — Take one of the former, adapt to your needs.
• Build your own (tl;dr: don’t)
PS: Thanks also for the book `Understanding SGML and XML tools'. I
have often found it a useful reference.
Yes, it's very good, but it's not suitable for authoring or editing text documents because it lacks some of the basic controls editors need.
See https://cora.ucc.ie/handle/10468/1690 for the gory details.
The problem with "simple" schemas is that they rapidly become
complicated. Norm Walsh put this more succinctly in his presentation on Underlying Technologies in the XML in Publishing track at the 2016 XML
Summer School:
Where do vocabularies come from?
• Adopt — Take your pick: XHTML, DocBook, JATS, TEI, DITA, …
• Adapt — Take one of the former, adapt to your needs.
• Build your own (tl;dr: don’t)
Thanks for the advice. I have decided to try PSGML mode again, after a
long gap. I see that the maintainers of the ELPA version have removed `psgml-ids.el', which seemed useful, for copyright reasons, and have
replaced it with other functions. I hope there is no problem with that.
I am partway through a writing project which will occupy a large part
of my time in the next few years. I am a mathematician, and the
subject of my writing project is some recent work on the foundations
of mathematics. The products of the project will be a collection of
"volumes" on the subject. There will be cross-references between
these volumes. Part of the product will be code in the language of
the proof assistant Coq. I will have to include delimited snippets of
the code in the text.
I could have used LaTeX; I have been using it for the last 28 years,
since the time I was a graduate student, for all my mathematical
writing, and am absolutely comfortable with it, like most
mathematicians are. However, I have always chafed at its non-semantic
aspect.
I have some experience with DocBook, but, for my current purpose, itYou can remove the bits you don't want from the RNG and recreate a new
has too many elements that are irrelevant.
In any case, I have to extend these schemas, to incorporate numbered statements like "Definition", "Lemma", "Proposition", "Theorem",
"Corollary", and, "Remark", for which I usually use the LaTeX package `ntheorem'. I also need XML equivalents of the `amsmath' equation environments, such as `eqnarray', and `split'. Things like `cases',
too.
For the mathematics itself, I am planning to use LaTeX markup,
which in the HTML rendition, will be displayed using MathJaX.
I found the work of the `mathbook' project
http://mathbook.pugetsound.edu/
very relevant to my work; they deal with many of the above issues.
That is the background to my current notion that I have to write my own schema.
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 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'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...
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).
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.
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.
On 21/05/18 04:00, N. Raghavendra wrote:
I have enclosed the schema `mono.rnc' below. I would be grateful if
you have any suggestions.
I'm afraid I won't now get a chance to look at this until October.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 418 |
Nodes: | 16 (2 / 14) |
Uptime: | 51:22:53 |
Calls: | 8,816 |
Calls today: | 12 |
Files: | 13,307 |
Messages: | 5,973,402 |