Wednesday, 14 May 2008

XSLT in the browser

XSLT in the browser, its original motivating use case, has had a somewhat difficult time, but with support finally appearing in Opera and Safari, and the support in IE and Firefox/mozilla being fairly stable it looked like perhaps its time had come (even if stuck in an XSLT 1 era).

But then came Firefox 3 beta 5.....

Firefox has decided that relative links that traverse the filesystem out of the current directory are a security error. They are (pretty confusingly) reported as XML parse error rather than a security error.

https://bugzilla.mozilla.org/show_bug.cgi?id=427333

This is pretty fatal to browsing XML files on the filesystem, at NAG for instance, the documentation is distributed as a directory tree of a few thousand XML files, at the top level is a styles directory and so the individual files have xml-stylesheet links linking to ../../styles/foo.xsl or whatever is needed. This works in all browsers that support XSLT at all, except firefox 3 beta 5. Where apparently the only solution is to change the link to href="foo.xsl" and then copy the stylesheet into dozens of directories. Blurgh....

I hope bug 427333 gets fixed before FF3 gets out of beta....

Update: ../ stylesheets work again in FF3 release candidate 1, yipee!

Wednesday, 9 April 2008

MathML3 Draft

The W3C Math WG has just published a new working draft of MathML3

http://www.w3.org/TR/2008/WD-MathML3-20080409

As always, comments are welcome on the www-math@w3.org mailing list

Thursday, 10 January 2008

XML position at NAG

NAG is recruiting again.

There are several positions available, including one in my group, "XML Technologies".

Friday, 14 December 2007

Three new W3C Working Drafts

Today the W3C published three new working drafts

MathML3 Several new features worked on this time, more Content MathML improvements, more information on layouts for elementary mathematics (long division, etc.), and the first draft of a Relax NG Schema. Also, we have re-instated the XHTML+MathML version of the spec.

A MathML for CSS profile I'm down as co-editor of this, but all the main credit should go to George Chavchanidze of Opera Software, who's continuing his long standing work of getting mathematical rendering using pure CSS declarations.

XML Entity definitions for Characters The latest iteration of the the definitions of Characters. This was formerly part of the MathML spec (Chapter 6) but had been separated out and extended to include all the ISO entity sets, and the HTML Entity sets. I still hope that eventually this can be a joint ISO/W3C publication, updating ISO/IEC TR 9773-13. We'll see...

Sunday, 2 December 2007

Mathematics in PowerPoint 2007

I've never used PowerPoint, but I've been investigating recently the mathematical and in particular MathML capabilities of the Office 2007 suite.

It's been noted in several places that PowerPoint doesn't support the new Word 2007 math zones and that if you cut and paste a math expression from Word to PowerPoint, the result is an image, which means you can't edit it or search on it in that form, and it looks horrible on screen, especially if you have background colour or textures applied to your slides.

This note is just to mention a mechanism of getting correctly rendered editable mathematical text into PowerPoint, in a form which has the full oomml XML markup in the pptx file, so you can extract that and convert to MathML if needed using the Microsoft supplied stylesheet. I suspect that this mechanism is (or ought to be) well known by anyone (not me!) who's used PowerPoint, but a google search didn't show up anyone else mentioning it in this context, so I thought I'd post...

To get a math expression inserted, don't cut and paste a math zone from word, in Powerpoint choose
insert / Object /MicroSoft Word Document
then make a 'document' consisting of the equation you need using the embedded copy of Word. the resulting equation will be saved as an embedded object, and if you unzip the pptx PowerPoint file you will find a docx version of the embedded object in the embeddings directory, which you can further unzip to locate the oomml math XML.

The resulting equation renders as text rather than an image and may be edited at any time later, just click on it and you get thrown into a copy of Word.

Screen shot with one of Word's example equations rendered twice in a PowerPoint slide, once as an embedded object and once as an image.

Thursday, 29 November 2007

XML Entity definitions for Characters

In many contexts people find it convenient to enter characters that are not on the keyboard as entity references, such as &rightarrow; to get an arrow rather than remembering what keyboard shortcut or numeric reference (&#x2192;) would produce this. In many cases, life would be simpler if people did not do this: having entity references means that not only do you need a <!DOCTYPE declaration to reference a DTD that defines the entities, you need your XML parser to read the DTD, and it makes processing fragments of XML much harder, as either the fragments do not have a <!DOCTYPE (in which case they are not, themselves, well formed) and the fragment pasting operation needs to ensure that a suitable DTD reference is placed on the target document, or the fragments do have a doctype, and the fragment pasting needs to strip this off, and still ensure that the target document has a compatible DTD.

If fragments are being moved from one place to another this can be difficult. Consider moving a fragent of MathML from an XHTML document to Docbook for example. XHTML and Docbook define entities with in several case the same name but different definition (the original ISO definitions of the entity names did not give definitions in terms of Unicode characters) and older versions of Unicode did not have sufficient technical symbols to give sensible definitions for most of these names.

All of which preamble is just leading up to say Unicode 5.1 (Beta) does have suitable characters for all the ISO and MathML entities..

The Entity draft at http://www.w3.org/2003/entities has thus been updated to a new "2007" version, which we (the W3C Math WG) hope to submit to W3C as a new Recommendation track document shortly, but you can view my Editor's Draft here.

MathML3 will hopefully use these by reference, if (X)HTML (and possibly other non-W3C systems such as Docbook) could do the same, then hopefully we would finally have a set of entity names with widespread consistent use across multiple languages. Hopefully.

Over the years I've been maintaining these sets we've kept fairly regular contact with the STIX group and the tables of characters in the above document include characters typeset with the STIX Fonts (if you have them installed, and they work in your browser. (The plane 1 characters still fail for me in all browsers on windows).

Comments are welcome, either in this blog, or better on www-math@w3.org.

Tuesday, 27 November 2007

More STIX Experiments

Having posted a small test file to the stix comment page , I noticed that the stix site has a larger test file (choose "STIX Font Glyph Tables" from the menu options on the STIX site, which will take you to
http://www.stixfonts.org/allGlyphs.html.

This differs from my test (apart from being rather larger) in that each cell is individually assigned an appropriate font with separate CSS classes rather than having a single CSS font list and relying on the font choice to fall through fonts that do not have the appropriate glyph. The results are different but still a bit disappointing.

Three images of my Windows XP setup, one of the Font directory just to show they are there, one of the top of the allGlyphs file showing side by side in Firefox 2.0.0.9, Opera 9.21 and IE 7.0.5730.11, note that only FF actually shows the bold and italic variants. then the same three browsers showing the bottom of the file. here FF is all white, Opera is white for some characters and two missing glyph markers for others, and IE is mainly white but strangely enough actually renders the last few entries, which are monospace digits.

The images link to larger screen dumps which show (or rather do not show) the glyphs more clearly.