[MOBY-dev] xml:lang the story isn't pretty...
Mark Wilkinson
markw at illuminae.com
Fri Jun 22 17:03:58 UTC 2007
Hi all,
One of the TODO's that was assigned to me was the task of getting MOBY
Central prepared for multi-lingual support. I've been investigating how
to do this, and it looks like it is going to be a bit of a blocker.
According to the XML specification, the xml:lang attribute is supposed to
apply to the node it is in, and any sub-node until another xml:lang
attribute is encountered. Unfortunately, most of the XML parsing
libraries in Perl do not even notice the xml:lang attribute as "special",
so you only have access to it as a normal attribute in the node where it
is included.
There is one XML parsing library in Perl that does keep track of this
attribute (XML::LibXML::Reader); however that is not available on Windows
using ActiveState's Perl and PPM, which is what most Windows users will be
using, I suspect.. (though I know it is possible to use Cygwin also). I
also looked at the "theoryx" PPM repository in Winnipeg, which usually has
some odd modules that you can't get anywhere else, but it isn't there
either.
So... I guess there are several possibilities:
1) we attempt to compile XML::LibXML::Reader on Windows and distribute it
as part of Moby
1a) we modify XML::LibXML such that it does recognize and make note of
this attribute, and contribute that back to the authors
2) I re-code Moby such that it traverses back up the XML tree looking for
the last xml:lang attribute for every node that has content.
3) We put an additional constraint on the rules of XML, requiring that
the xml:lang attribute must be present in the same node in which the
multilingul content is present.
4) ??? give up :-)
Can someone have a quick look at how well xml:lang is supported on the
Java side, since that will help us make the decision on what to do. If it
isn't supported in the Java libraries either, then maybe #3 is the only
rational (ugly) solution?
M
--
--
Mark Wilkinson
Assistant Professor, Dept. Medical Genetics
University of British Columbia
PI Bioinformatics
iCAPTURE Centre, St. Paul's Hospital
Tel: 604 682 2344 x62129
Fax: 604 806 9274
***CONFIDENTIALITY NOTICE***
This electronic message is intended only for the use of the addressee and
may contain information that is privileged and confidential. Any
dissemination, distribution or copying of this communication by
unauthorized individuals is strictly prohibited. If you have received this
communication in error, please notify the sender immediately by reply
e-mail and delete the original and all copies from your system.
More information about the MOBY-dev
mailing list