accessing the XML attribute value noNamespaceSchemaLocation thru Python 2.5

Stefan Behnel stefan_ml at behnel.de
Thu Jun 4 19:41:13 CEST 2009


tooshiny wrote:
> I am currently successfully using lxml and ElementTree to validate and
> to access the XML contained data. I can however not find any
> functional call to access the schema location ie the attribute value
> noNamespaceSchemaLocation.
> 
> A simple function call would be so much nicer than the other route of
> file reading / string chopping etc

I'm not quite sure what you are trying to do here, but to access an
attribute of an Element object, you can use its get() method, as in

root.get("{http://www.w3.org/2001/XMLSchema-instance}noNamespaceSchemaLocation")

Or did you mean to do something else?

Stefan



More information about the Python-list mailing list