11 Sep 22:13
Serialization with namespaces
From: Anders Bruun Olsen <anders <at> bruun-olsen.net>
Subject: Serialization with namespaces
Newsgroups: gmane.comp.python.lxml.devel
Date: 2007-09-11 20:14:11 GMT
Subject: Serialization with namespaces
Newsgroups: gmane.comp.python.lxml.devel
Date: 2007-09-11 20:14:11 GMT
Hi,
I need to chop up some XML based on XPath expressions and serialize the
resulting chunks individually. I thought LXML would be perfect for this
task but have run into some problems.
Here is the sample I use, test.xtm:
<?xml version="1.0" encoding="UTF-8"?>
<topicMap
xmlns="http://www.topicmaps.org/xtm/1.0/"
xmlns:xlink="http://www.w3.org/1999/xlink"
id="personnavnereg1">
<topic id="abeleHenriksdatter">
<instanceOf>
<topicRef xlink:href="person-template.xtmp#kvinde"/>
</instanceOf>
<baseName>
<baseNameString>Abele Henriksdatter i Radsted,
Gotfred Bangs hustru</baseNameString>
</baseName>
<occurrence>
<instanceOf>
<topicRef
xlink:href="DDref.xtmp#dato1407.01.06"/>
</instanceOf>
<resourceRef
xlink:href="http://xxx/diplomer/07-002.html"/>
</occurrence>
</topic>
</topicMap>
(Continue reading)
RSS Feed