CSS Warrior

Subscribe to RSS feed

Posts tagged with "xml"

MathML story continues

, , ,

Recently I joined W3C Math working group, where I will represent Opera Software. I am not the biggest supporter of MathML and often am considered among its oponents, however there are a lot of thing that can be done on MathML side and solving the existing problems requires some kind of coordination between Math WG, CSS folks and browser developers.

The intention is to address MathML/CSS compatibility issues that would make integration of MathML with the rest of technologies supported by browsers much easier. Today it is hard to judge what the actual outcome will be, but in overall I am optimistic as it seems that essential part of MathML can be reformulated in more CSS friendly manner and with a few CSS3 extensions one may merge it in XML + CSS framework.

Once the technical issues will be resolved and realistic spec will be available I think browsers will be able to reconsider their position on MathML support. Not sure whether this will finally bring more MathML content to web as being quite verbose MathML distracts essential part of potential users especially those from LaTeX community, but in the same time MathML3 may have both XML and non-XML input syntax like RELAX NG and XQuery have, so if successful this step may provide some kind of bridge between LaTeX and XML communities.



New Markup for Mathematical Articles

, , , ...

Work on new version of XML MAIDEN markup language that was started in august is finally done and XML MAIDEN 2.0 DTD was submitted to OASIS schema registry. Markup can be used to capture general structure of scientific articles (front matter, headers, sections, statements, paragraphs, references etc) and to outline basic structure of mathematical expressions in the way suitable for rendering with CSS.

Mathematical part of XML MAIDEN 2.0 DTD was carefully revised in order to remove existing nesting limitations and create markup that can handle arbitrary complex formulae obtained by combining common mathematical expressions such as indices (arbitrary complex subscripts, superscripts, prescripts, under and over scripts), fractions (including arbitrary deeply nesting ones), operators (with arbitrary complex, multiple under and over scripts), fences, radicals, matrices (including deeply nested ones, with markers), determinants, vectors and etc.

Scope and capabilities of mathematical DTD are roughly aligned with those of Electronic Manuscript Standard. DTD admits universal CSS2.1 style sheet that can imitate native support without imposing limitations on complexity of mathematical expressions. Certain restricted subset of XML MAIDEN DTD is interoperable and suitable for rendering in current browsers including Opera 7/8/9 , Mozilla 1.x, Safari 1.x and MSIE 5.5/6.0. Full DTD however requires stronger CSS2.1 support (flawless support for inline-blocks and inline-tables is crucial for proper functionality of default style sheet).



Hyperlinks in XML

,

More then six years passed since W3C introduced XML 1.0 but we still don't have reasonable linking mechanism. The question is very simple: how to add simple hyperlink like
<a href="http://www.w3.org">W3C</a>

to XML page?
I must confess that I know no reasonable answer. Any suggestions?
W3C suggests to use XLink 1.0 and to code our simple link as follows
<a xlink:type="simple" xlink:href="http://www.w3.org" xlink:actuate="onRequest" xlink:show="replace" xmlns:xlink="http://www.w3.org/1999/xlink">W3C</a>

Hard to imagine more awkward solution. The more interesting is that, according to XLink 1.0 recomendation, xlink:type attribute is required (otherwise link is not processed) while xlink:href attribute is optional. For example this is valid XLink 1.0
<a xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink">W3C</a>

and this is invalid one:
<a xlink:href="http://www.w3.org" xmlns:xlink="http://www.w3.org/1999/xlink">W3C</a>

Everything this is so stupid that in a few years even W3C realised that one has to "make XLink easier to use" and released XLink 1.1 WD that "solves" the problem by specifying default value for xlink:type attribute. So in near future when XLink 1.1 will be approved one will be able to use compact markup like
<a  xlink:href="http://www.w3.org" xlink:actuate="onRequest" xlink:show="replace" xmlns:xlink="http://www.w3.org/1999/xlink">W3C</a>

Very well, but how about those who have nonstandard view on notion of compactness?
Those can omit xlink:actuate and xlink:show attributes like:
<a  xlink:href="http://www.w3.org"  xmlns:xlink="http://www.w3.org/1999/xlink">W3C</a>

however now it is hard to say how XLink processor will handle link as attributes xlink:actuate and xlink:show have no default values (let's hope that after several years W3C will issue XLink 1.2 that supplies default values) and according to XLink 1.1 WD "the behavior of an application traversing to the ending resource is unconstrained by this specification." So still no joy. Let us leave XXXLink developers alone and see what else can be done.

There are CSS linking extensions used by Opera and Prince formatter that provide flexible control over linking via CSS style sheets. With linking extensions we would be able to use arbitrary markup like
<go to="http://www.w3.org">W3C</go>

and define behaviour via CSS like
go[to] {prince-link:attr(to)}

However W3C CSS WG did not standardize them as (allegedly) it does not fit well in general scope of current web standards or maybe because unlike XLink it does not reveal full power of human stupidity.


Thus we are left with XHTML hyperlinks module that in fact can be used in any XML document.
However there still is the price that one have to pay: XHTML namespace declaration must be placed in internal DTD subset (otherwise using namespace prefixes or putting namespace declaration on each link would be inevitable). It looks like
<!ATTLIST a xmlns CDATA "http://www.w3.org/1999/xhtml">

and allows to use XHTML hyperlinks in XML without adding xmlns attribute to each link explicitly, like in old lovely times, before people invented namespaces
<a href="http://www.w3.org">W3C</a>


Looks much better, but how about those who prefers not to pollute internal DTD subset? Any ideas?