W3C home > Mailing lists > Public > www-math@w3.org > February 2010

Re: Machine readable information about elements and attributes

From: David Carlisle <davidc@nag.co.uk>
Date: Tue, 02 Feb 2010 12:24:58 +0000
Message-ID: <4B68199A.2040902@nag.co.uk>
To: Urs Holzer <urs@andonyar.com>
Cc: www-math@w3.org
On 02/02/2010 12:05, Urs Holzer wrote:
> Hi together
>
> 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)
> - Number of children
> - List of all attributes of an element
> - Default value of an attribute
> - Inheritance of attribute values
> - Link to the section of the specification that describes a given element
> or attribute
>
> Is such information available in a form which can be parsed by my
> application, or do I have to extract it from the specification by hand
> (maybe using some clever XSLT)? If I have to do it by hand, do you have
> any suggestion how I should encode it? Maybe it could be useful for
> other projects too.
>
> Greetings
> Urs
>

the first two would be fairly easily extracted from the rng version of 
the schema, but not the last two.

The attributes (and their defaults) are fairly systematically marked up 
now in tables (although using a different format for presentation and 
content as content has far fewer attributes) you would be able extract 
this fairly easily with xslt from the xhtml version of the spec. eg
the table at

http://www.w3.org/TR/MathML3/chapter3.xml#id.3.3.2.2

could be processed to tell you the attributes of mfrac and their default 
values (and of course give you the required link back to the spec)

The schema is (largely) automatically generated (by xslt) from the xml 
sources of these tables (which are in the w3c's xmlspec markup vocabulary)

We don't currently make the xmlspec sources public, but possibly it is 
better anyway to use the xhtml version of the spec. Some things are a 
bit more explict in the xmlspec sources, but generating back links to 
the spec would be easier from the xhtml.

For MathML2 we made available a zip file of all the XML sources and 
transformations used to make the spec. we don't for MathMl3 but I don't 
think that that is because of any particular desire to keep them secret, 
just it's simpler not to package them and document how they are used, 
and no one asked for them...

David





________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. 
________________________________________________________________________
Received on Tuesday, 2 February 2010 12:25:30 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 20 February 2010 06:13:06 GMT