Re: [xml-bindings]Naespaces of attributes in python API



On Wed, Jun 19, 2002 at 07:23:01PM +0200, rm fabula de wrote:
> Just a quick question:
> 
>  how can i specify the naespace of an attribute that i want
>  to add to an existing node with node.setProp('x', 'y') ?

  Find the namespace node profinding the declaration for that namespace

    def searchNsByHref(self, doc, href):
        """Search a Ns aliasing a given URI. Recurse on the parents
           until it finds the defined namespace or return None
           otherwise."""

and then use it to make a namespaced attribute

    def setNsProp(self, ns, name, value):
        """Set (or reset) an attribute carried by a node. The ns
           structure must be in scope, this is not checked."""

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]