Re: Machine readable information about elements and attributes

2010-02-02 13:24 David Carlisle <davidc@nag.co.uk>:
> On 02/02/2010 12:05, Urs Holzer wrote:
> > My MathML editor needs the following information about MathML elements
> > and their attributes:
> > - Whether an element is considered Content MathML or Presentation MathML
> > (or both)

The RELAX NG is organized in a modular way, separating Content from
Presentation.  Otherwise a simple heuristics may help, such as: anything
starting with "c" is Content, anything starting with "m" (except known
Pragmatic Content MathML symbols) is Presentation, and the rest is – no idea.

> > - Number of children
> > - List of all attributes of an element

David has already answered these.  Still I don't know whether there are any
usable libraries that allow you to parse e.g. RELAX NG into an internal
representation that you can not just use for validation but also query in the
desired way.  I mean more easily than e.g. XQuerying RNG.  There should be
something, as any good XML editor would need it.

> > - Default value of an attribute

Technically this can also be implemented in a DTD, but not everybody
recommends doing so, and I don't recall whether it is done for MathML.  So I'd
follow David's approach here, as for the inheritance you need to process the
spec anyway.

Cheers,

Christoph

-- 
Christoph Lange, Jacobs Univ. Bremen, http://kwarc.info/clange, Skype duke4701

Received on Tuesday, 2 February 2010 13:04:52 UTC