accessing the XML attribute value noNamespaceSchemaLocation thruPython 2.5

T

tooshiny

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

Can anybody help

Many thanks
 
S

Stefan Behnel

tooshiny said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top