Skip navigation.

exploreopera

| Help

Sign up | Help

CSS Warrior

Posts tagged with "web"

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



MSIE7 will not support application/xhtml+xml

, ,

Several years passed since application/xhtml+xml MIME type was registered but on real web you will hardly find XHTML documents served with proper MIME type. The reason is simple — browser side support.

MSIE6 does not recognize application/xhtml+xml documents at all and as Cris Wilson (MSIE developer) recently wrote upcoming MSIE7 will not support application/xhtml+xml MIME type either. Microsoft with its fifty thousands employees has no resources :wink: to update XML parser. Neither Mozilla foundation with its six billions potential developers managed to implement XHTML decently — Gecko based browsers can't render X(HT)ML documents incrementally and users have to wait before page fully loads. Opera too had problems with XHTML. Until version 7.5 it did not execute JavaScript when page was served as application/xhtml+xml, so Opera 8 is probably first version that handles application/xhtml+xml properly. It is unclear when MSIE and Mozilla will follow Opera and finally make XHTML usable. Until then HTML tagsoup will prosper.

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?



Towards universal math style sheet

, ,

In spite of the fact that world wide web emerged in one of the center of European science — CERN, web standards failed to address needs of scientific community and most of current scientific articles (especially in technical areas like mathematics, physics and chemistry) are distributed in PDF format instead of more accessible and web friendly XML based solutions. One of the reasons for current situation is inability of browsers to render mathematical expressions. One way to address problem is to implement presentational MathML in all browsers.

Another one that was frequently discussed on Opera forums it to find CSS based solution.
The idea behind universal math style sheet was to write single CSS2.1 style sheets that would handle arbitrary complex math formulae obtained by combining and nesting subscripts, uperscripts, prescripts, under and over scripts, fractions, operators, matrices, vectors, determinants, cases, accents, fences, radical and other mathematical expressions. In this case any good CSS rendering engine would be able to render mathematical expressions without having native LaTeX/MathML/EMS support. The good news is that such a style sheet exists :idea: (that was not obvious from the first glance) and even works in one CSS rendering engine Prince 5 :smile: (CSS formatter developed by YesLogic). The bad news however that browsers does not have sufficient CSS2.1 support yet to process style sheet properly :cry:
Style sheet affords torture tests that are analog of MathML torture tests and contain some complex math expressions. Opera can't get them right, but
after fixing some CSS related bugs it should be able to render these and other much more complex formulae. Below are screen shots that show how Prince CSS formatter handles tests:

Formulae 1-7
Formulae 6-11
Formulae 12-19
Formulae 15-22
Formulae 23-28