I can't fetch dom node in svg file with getElementById method (module minidom and libxml2dom)

Paul Boddie paul at boddie.org.uk
Mon Aug 25 18:29:01 EDT 2008


On 25 Aug, 14:56, KLEIN Stéphane <steph... at is-webdesign.com> wrote:
>

[DOM implementations, identifiers and validation]

> Thanks ! It work.

I've since updated libxml2dom to support validation and provide a more
reliable getElementById method. Unfortunately, I can't seem to make
the example document validate against any of the official SVG DTDs,
and yet it seems necessary to ask libxml2 to perform validation in
order to make getElementById return desirable results (in the presence
of mere references to the DTDs rather than inlining the huge DTDs
themselves).

Interestingly, the example from the Wikipedia page on SVG, with some
id attributes added, appears to work just fine:

http://en.wikipedia.org/wiki/Scalable_Vector_Graphics

Anyway, if this is interesting, please refer to the repository I
mentioned earlier - a release will eventually be made incorporating
these improvements.

Paul



More information about the Python-list mailing list