jnpr/space/resource.py
def form_xml(self):
        """Forms an XML representation of the state of this resource based on
        its attribute values.

        :returns: An ``lxml.etree.Element`` object representing the state of
            this resource.

        """
        ele = etree.Element(self._meta_object.xml_name)
        attributes = {}
        if self._attributes is not None:
            attributes = self._attributes
        else:
            attributes = self.__dict__

        for key, value in attributes.items():
            if key.startswith('_'):
                continue

            xml_name = util.make_xml_name(key)
            if xml_name == 'href':
                ele.attrib[xml_name] = str(value)
            elif isinstance(value, Resource):
                ele.append(value.form_xml())
            elif isinstance(value, list):
                lst = etree.SubElement(ele, xml_name)
                for each in value:
                    lst.append(each.form_xml())
            elif isinstance(value, dict):
                dct = etree.SubElement(ele, xml_name)
                for key, val in value.items():
                    if key == 'href':
                        dct.attrib[key] = str(val)
                    else:
                        etree.SubElement(dct,
                                         util.make_xml_name(key)).text = str(val)
            else:
                etree.SubElement(ele, xml_name).text = str(value)

        return ele
Forms an XML representation of the state of this resource based on
        its attribute values.

        :returns: An ``lxml.etree.Element`` object representing the state of
            this resource.

        
Forms an XML representation of the state of this resource based on
its attribute values.
Forms an XML representation of the state of this resource based on its attribute values .
def form_xml(self):
        ele = etree.Element(self._meta_object.xml_name)
        attributes = {}
        if self._attributes is not None:
            attributes = self._attributes
        else:
            attributes = self.__dict__
        for key, value in attributes.items():
            if key.startswith('_'):
                continue
            xml_name = util.make_xml_name(key)
            if xml_name == 'href':
                ele.attrib[xml_name] = str(value)
            elif isinstance(value, Resource):
                ele.append(value.form_xml())
            elif isinstance(value, list):
                lst = etree.SubElement(ele, xml_name)
                for each in value:
                    lst.append(each.form_xml())
            elif isinstance(value, dict):
                dct = etree.SubElement(ele, xml_name)
                for key, val in value.items():
                    if key == 'href':
                        dct.attrib[key] = str(val)
                    else:
                        etree.SubElement(dct,
                                         util.make_xml_name(key)).text = str(val)
            else:
                etree.SubElement(ele, xml_name).text = str(value)
        return ele
def form_xml ( self ) : ele = etree . Element ( self . _meta_object . xml_name ) attributes = { } if self . _attributes is not None : attributes = self . _attributes else : attributes = self . __dict__ for key , value in attributes . items ( ) : if key . startswith ( '_' ) : continue xml_name = util . make_xml_name ( key ) if xml_name == 'href' : ele . attrib [ xml_name ] = str ( value ) elif isinstance ( value , Resource ) : ele . append ( value . form_xml ( ) ) elif isinstance ( value , list ) : lst = etree . SubElement ( ele , xml_name ) for each in value : lst . append ( each . form_xml ( ) ) elif isinstance ( value , dict ) : dct = etree . SubElement ( ele , xml_name ) for key , val in value . items ( ) : if key == 'href' : dct . attrib [ key ] = str ( val ) else : etree . SubElement ( dct , util . make_xml_name ( key ) ) . text = str ( val ) else : etree . SubElement ( ele , xml_name ) . text = str ( value ) return ele
Forms an XML representation of the state of this resource based on
its attribute values.
Forms an XML representation of the state of this resource based on its attribute values .
"""Forms an XML representation of the state of this resource based on
        its attribute values.

        :returns: An ``lxml.etree.Element`` object representing the state of
            this resource.

        """
An ``lxml.etree.Element`` object representing the state of
this resource.
An ` ` lxml . etree . Element ` ` object representing the state of this resource .
self