xml2po and attributes with namespaces
- From: Carsten Senger <senger rehfisch de>
- To: gnome-web-list gnome org, Gnome i18n <gnome-i18n gnome org>
- Subject: xml2po and attributes with namespaces
- Date: Thu, 24 Sep 2009 13:20:42 +0200
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.
Cheers,
..Carsten
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]