[lxml-dev] objectify and processing instructions
Stefan Behnel
stefan_ml at behnel.de
Thu Jul 16 07:14:40 CEST 2009
Hi,
Emanuele D'Arrigo wrote:
> having a piece of xml such as:
>
> <?xsl-transform href="test.xsl" type="text/xsl"?>
> <aRoot />
>
> I can use:
>
> xmlObject = objectify.fromstring()
> piElement = xmlObject.getprevious()
>
> but the returned object (differently from an xml object generated with
> etree.fromstring()), is not a processing instruction but an
> ObjectifiedElement, and doesn't seem to give me access to the href and type
> attributes. I'm aware that they are actually a single pseudo-attribute, but
> how do I access it?
Hmmm, without looking into it myself, this sounds like a bug to me. It
shouldn't return an ObjectifiedElement for Processing instructions, a
normal etree PI element should work here (given that there are no children,
for example).
Stefan
More information about the lxml-dev
mailing list