[lxml-dev] id function of xpath and parseid
Daniel Albeseder
daniel.albeseder at tttech.com
Mon Jul 27 11:43:17 CEST 2009
On Mon, 2009-07-27 at 10:49 +0200, Daniel Albeseder wrote:
> Additionally I wonder, how the `id` function of XPath does work with
> lxml. I created a schema-aware parser, which reads an XML-file, where
> some attributes are declared as xs:ID inside the schema. However the
> `xpath` method always returns an empty list of nodes, even if the IDs
> given are inside the XML.
I just found in the archive, that it only seems to work with either an
xml:id attribute or a given DTD. However since XML Schema is the modern
way to restrict XML-files, and XML schema also has the xsd:ID attribute
type, I see not reason, why this does not work.
The XPath specification does talk about DTDs, thats correct, but since
this specification is older than the XML Schema document and XML schema
is designed to be a superset of DTD (and even to replace it), it sounds
strange, that some features only work for DTDs.
Best regards
Daniel
More information about the lxml-dev
mailing list