Re: xml2po and attributes with namespaces
- From: Claude Paroz <claude 2xlibre net>
- To: Carsten Senger <senger rehfisch de>
- Cc: Gnome i18n <gnome-i18n gnome org>, gnome-web-list gnome org
- Subject: Re: xml2po and attributes with namespaces
- Date: Thu, 24 Sep 2009 13:30:41 +0200
Le jeudi 24 septembre 2009 à 13:20 +0200, Carsten Senger a écrit :
> Hi all,
>
> I'm working on an im-/export of translations so plone can be used as the
> cms for www.gnome.org.
> My current prototype exports the translatable content as html files and
> works with xml2po's xhtml mode.
> For the import I need to carry some more information inside the html files.
> First I thought about encoding them into xhtml's id attribute, but using
> custom attributes with a namespace is cleaner.
>
> So currently the exported markup looks like this:
>
> <?xml version="1.0" encoding="utf-8"?>
> <html xmlns:translation="http://gnome.org/namespaces/wgotranslation"
> xmlns="http://www.w3.org/1999/xhtml">
> <head />
> <body>
> <div translation:handler="ATField"
> translation:uid="66be431c98adabc42d86a09f52f94258"
> translation:name="description">
> Translatable Text, maybe with xhtml markup
> </div>
> ...
>
> Creating the pot file and merging the messagestrings back works, but xml2po
> strips the namespace prefix from the attribute:
>
> ?xml version="1.0" encoding="utf-8"?>
> <html xmlns:translation="http://gnome.org/namespaces/wgotranslation"
> xmlns="http://www.w3.org/1999/xhtml">
> <head/>
> <body xml:lang="DE">
> <div handler="ATField" uid="66be431c98adabc42d86a09f52f94258"
> name="description">
> ....
>
> While it's not essential for the import (there will be no conflict with
> valid attributes for <div>) it would be nice if xml2po could preserve the
> namespace prefix like it preserved the prefix definition.
> I've looked at the xml parsing code of xml2po, but I've never worked with
> libxml and have no clue how to fix it.
Please enter a bug with sample files in Bugzilla xml2po product.
I'm currently in the process of partially rewriting xml handling in
xml2po, so it might be a good time to add this sort of bug/requirement.
Claude
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]