accessing the XML attribute value noNamespaceSchemaLocation thruPython 2.5

Discussion in 'Python' started by tooshiny, Jun 3, 2009.

  1. tooshiny

    tooshiny Guest

    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
     
    tooshiny, Jun 3, 2009
    #1
    1. Advertisements

  2. 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
     
    Stefan Behnel, Jun 4, 2009
    #2
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.