Extracts objects representing and interacting with the settings in the
        xml tag.
355765
def _parse_xml(self, xml):
        
        vms("Parsing <static> XML child tag.", 2)
        for child in xml:
            if "path" in child.attrib and "target" in child.attrib:
                if child.tag == "file":
                    self.files.append({"source": child.attrib["path"],
                                       "target": child.attrib["target"]})
                elif child.tag == "folder":
                    self.folders.append({"source": child.attrib["path"],
                                         "target": child.attrib["target"]})
967181
def parse_xml(self, key_xml):
        '''
            
        '''
        xmlutils = XmlUtils(key_xml)
        self.name = xmlutils.get_string_by_xpath('name')
        self.family = xmlutils.get_string_by_xpath('family')
        self.version = xmlutils.get_string_by_xpath('version')
        self.description = xmlutils.get_string_by_xpath('description')

        self.language = xmlutils.get_lang()
157810
def parse_xml(self, node):
        
        self._set_properties(node)
        self.background_color = node.get('backgroundcolor',
                                         self.background_color)

        # ***         do not change this load order!         *** #
        # ***    gid mapping errors will occur if changed    *** #
        for subnode in node.findall('layer'):
            self.add_layer(TiledTileLayer(self, subnode))

        for subnode in node.findall('imagelayer'):
            self.add_layer(TiledImageLayer(self, subnode))

        for subnode in node.findall('objectgroup'):
            self.add_layer(TiledObjectGroup(self, subnode))

        for subnode in node.findall('tileset'):
            self.add_tileset(TiledTileset(self, subnode))

        # "tile objects", objects with a GID, have need to have their attributes
        # set after the tileset is loaded, so this step must be performed last
        # also, this step is performed for objects to load their tiles.

        # tiled stores the origin of GID objects by the lower right corner
        # this is different for all other types, so i just adjust it here
        # so all types loaded with pytmx are uniform.

        # iterate through tile objects and handle the image
        for o in [o for o in self.objects if o.gid]:

            # gids might also have properties assigned to them
            # in that case, assign the gid properties to the object as well
            p = self.get_tile_properties_by_gid(o.gid)
            if p:
                for key in p:
                    o.properties.setdefault(key, p[key])

            if self.invert_y:
                o.y -= o.height

        self.reload_images()
        return self
1190610
private void parseNesting(Configuration configuration, Document dc) {
        NodeList list = dc.getElementsByTagNameNS(SCHEMA_LOCATION, TAG_NESTING);
        if (list.getLength() > 0) {
            Node el = list.item(0);
            configuration.setNestingLimit(nodeAttribute(el, TAG_NESTING_ATTR_LIMIT, Configuration.DEFAULT_NESTING_LIMIT));
            configuration.setPropagateNestingException(
                    nodeAttribute(el, TAG_NESTING_ATTR_EXCEPTION, Configuration.DEFAULT_PROPAGATE_NESTING_EXCEPTION)
            );
        }
    }
194611
protected void processObjectTag(ObjectTag tag) {

        CmsRelationType type = CmsRelationType.valueOf(tag.getTagName());
        for (int i = 0; i < OBJECT_TAG_LINKED_ATTRIBS.length; i++) {
            String attr = OBJECT_TAG_LINKED_ATTRIBS[i];
            processLink(tag, attr, type);
            if ((i == 0) && (tag.getAttribute(attr) != null)) {
                // if code base is available, the other attributes are relative to it, so do not process them
                break;
            }
        }
        SimpleNodeIterator itChildren = tag.children();
        while (itChildren.hasMoreNodes()) {
            Node node = itChildren.nextNode();
            if (node instanceof Tag) {
                Tag childTag = (Tag)node;
                if (TAG_PARAM.equals(childTag.getTagName())) {
                    processLink(childTag, ATTRIBUTE_VALUE, type);
                }
            }
        }
    }
112485
def xml_get_tag(xml, tag, parent_tag=None, multi_line=False):
    
    expr_str = '[<:]' + tag + '.*?>(?P<matched_text>.+?)<'
    if parent_tag:
        expr_str = '[<:]' + parent_tag + '.*?>.*?' + expr_str
    expr = re.compile(expr_str, re.DOTALL | re.IGNORECASE)
    if multi_line:
        return expr.findall(xml)
    else:
        if expr.search(xml):
            return expr.search(xml).group('matched_text').strip()
        else:
            return None
927332
def parse(self, file):
        '''
        
        '''
        parser = make_parser()
        self.clear()

        class Extractor(xml.sax.ContentHandler):

            def __init__(self, parent):
                self.parent = parent

            def startElement(self, name, attrs):
                attribs = {}
                for attrname in attrs.getNames():
                    attrvalue = attrs.get(attrname)
                    attribs[attrname] = attrvalue
                self.parent.StartTag(name, attribs)

            def characters(self, text):
                self.parent.NewData(text)

            def endElement(self, name):
                self.parent.EndTag(name)
        parser.setContentHandler(Extractor(self))
        # OFFLINE MODE
        parser.setFeature(handler.feature_external_ges, False)
        fob = open(file, 'r')
        parser.parse(fob)
        return self.piece
858164
def restoreXml(self, xml):
        
        self.uiFilterTXT.setText(xml.get('filter', ''))
        
        xlevels = xml.find('levels')
        xloggerlevels = xml.find('logger_levels')
        xtree = xml.find('tree')
        
        if xlevels is not None and xlevels.text:
            self.setActiveLevels(map(int, xlevels.text.split(',')))
        if xloggerlevels is not None and xloggerlevels.text:
            for key in xloggerlevels.text.split(','):
                logger, lvl = key.split(':')
                lvl = int(lvl)
                self.setLoggerLevel(logger, lvl)
        
        if xtree is not None:
            self.uiRecordTREE.restoreXml(xtree)
217747
public void readTags(InputStream tagsXML)
    {
        SAXParserFactory factory = SAXParserFactory.newInstance();
        try
        {
            SAXParser saxParser = factory.newSAXParser();
            saxParser.parse(tagsXML, new TagsSaxHandler(this));
        }
        catch (ParserConfigurationException | SAXException | IOException ex)
        {
            throw new RuntimeException("Failed parsing the tags definition: " + ex.getMessage(), ex);
        }
    }
148576
def read_xml(cls, url, features, game, players):
        
        soup = MlbamUtil.find_xml("".join([url, cls.FILENAME]), features)
        return cls._generate_object(soup, game, players)
715012
function(xml) {
    var contexp, fn, formatted, indent, l, lastType, len, lines, ln, pad, reg, transitions, wsexp;
    reg = /(>)(<)(\/*)/g;
    wsexp = /[ ]*(.*)[ ]+\n/g;
    contexp = /(<.+>)(.+\n)/g;
    xml = xml.replace(reg, '$1\n$2$3').replace(wsexp, '$1\n').replace(contexp, '$1\n$2');
    pad = 0;
    formatted = '';
    lines = xml.split('\n');
    indent = 0;
    lastType = 'other';
    transitions = {
      'single->single': 0,
      'single->closing': -1,
      'single->opening': 0,
      'single->other': 0,
      'closing->single': 0,
      'closing->closing': -1,
      'closing->opening': 0,
      'closing->other': 0,
      'opening->single': 1,
      'opening->closing': 0,
      'opening->opening': 1,
      'opening->other': 1,
      'other->single': 0,
      'other->closing': -1,
      'other->opening': 0,
      'other->other': 0
    };
    fn = function(ln) {
      var fromTo, j, key, padding, type, types, value;
      types = {
        single: Boolean(ln.match(/<.+\/>/)),
        closing: Boolean(ln.match(/<\/.+>/)),
        opening: Boolean(ln.match(/<[^!?].*>/))
      };
      type = ((function() {
        var results;
        results = [];
        for (key in types) {
          value = types[key];
          if (value) {
            results.push(key);
          }
        }
        return results;
      })())[0];
      type = type === void 0 ? 'other' : type;
      fromTo = lastType + '->' + type;
      lastType = type;
      padding = '';
      indent += transitions[fromTo];
      padding = ((function() {
        var m, ref1, results;
        results = [];
        for (j = m = 0, ref1 = indent; 0 <= ref1 ? m < ref1 : m > ref1; j = 0 <= ref1 ? ++m : --m) {
          results.push('  ');
        }
        return results;
      })()).join('');
      if (fromTo === 'opening->closing') {
        formatted = formatted.substr(0, formatted.length - 1) + ln + '\n';
      } else {
        formatted += padding + ln + '\n';
      }
    };
    for (l = 0, len = lines.length; l < len; l++) {
      ln = lines[l];
      fn(ln);
    }
    return formatted;
  }
278126
private Set<Class<?>> getClasses(XML xml){
		HashSet<Class<?>> result = new HashSet<Class<?>>();
		
		// in case of override only the last global configuration must be analyzed
		Global global = null;
		
		for (Class<?> clazz : getAllsuperClasses(configuredClass)) {
			// only if global configuration is null will be searched global configuration on super classes
			if(isNull(global)){
				  
				global = xml.loadGlobals().get(clazz.getName());
				if(!isNull(global)){
					addClasses(global.getClasses(),result);
					if(global.getExcluded()!=null)
						for (Attribute attribute : xml.loadAttributes().get(clazz.getName()))
							for (String fieldName : global.getExcluded())
								if(attribute.getName().equals(fieldName))
									addClasses(attribute.getClasses(),result,attribute.getName());
				}
			}
			
			List<Attribute> attributes = xml.loadAttributes().get(clazz.getName());
			
			if(!isNull(attributes))
				for (Attribute attribute : attributes)
					if(    isNull(global) 
						|| isPresent(global.getExcluded(), attribute.getName())
					    || ( !isEmpty(global.getAttributes()) 
						     && !isPresent(global.getAttributes(), new SimplyAttribute(attribute.getName()))
						   )
					   )
					addClasses(attribute.getClasses(),result,attribute.getName());
		}
				
		return result;
	}
970788
def _parse_structured_metadata(obj, xml):
    
    for metadata in xml.xpath("cpt:structured-metadata/*", namespaces=XPATH_NAMESPACES):
        tag = metadata.tag
        if "{" in tag:
            ns, tag = tuple(tag.split("}"))
            tag = URIRef(ns[1:]+tag)
            s_m = str(metadata)
            if s_m.startswith("urn:") or s_m.startswith("http:") or s_m.startswith("https:") or s_m.startswith("hdl:"):
                obj.metadata.add(
                    tag,
                    URIRef(metadata)
                )
            elif '{http://www.w3.org/XML/1998/namespace}lang' in metadata.attrib:
                obj.metadata.add(
                    tag,
                    s_m,
                    lang=metadata.attrib['{http://www.w3.org/XML/1998/namespace}lang']
                )
            else:
                if "{http://www.w3.org/1999/02/22-rdf-syntax-ns#}datatype" in metadata.attrib:
                    datatype = metadata.attrib["{http://www.w3.org/1999/02/22-rdf-syntax-ns#}datatype"]
                    if not datatype.startswith("http") and ":" in datatype:
                        datatype = expand_namespace(metadata.nsmap, datatype)
                    obj.metadata.add(tag, Literal(s_m, datatype=URIRef(datatype)))
                elif isinstance(metadata, IntElement):
                    obj.metadata.add(tag, Literal(int(metadata), datatype=XSD.integer))
                elif isinstance(metadata, FloatElement):
                    obj.metadata.add(tag, Literal(float(metadata), datatype=XSD.float))
                else:
                    obj.metadata.add(tag, s_m)
1289438
def find_tags(self, tag_name, **attribute_filter):
        
        all_tags = [
            self.find_tags_from_xml(
                i, tag_name, **attribute_filter
            )
            for i in self.xml
        ]
        return [tag for tag_list in all_tags for tag in tag_list]
147589
def getXmlText (parent, tag):
    """"""
    elem = parent.getElementsByTagName(tag)[0]
    # Yes, the DOM standard is awful.
    rc = []
    for node in elem.childNodes:
        if node.nodeType == node.TEXT_NODE:
            rc.append(node.data)
    return ''.join(rc)
426358
def parse(self, parser, xml):
        """"""
        #We can only process references if the XML tag has inner-XML
        if xml.text is not None:
            matches = parser.RE_REFS.finditer(xml.text)
            if matches:
                for match in matches:
                    #Handle "special" references to this.name and param.name here.
                    self.references.append(match.group("reference"))

        #We also need to get all the XML attributes into the element
        for key in list(xml.keys()):
            self.attributes[key] = xml.get(key)
567182
def load_xml_attrs(self):
        

        attrs_list = list()

        if hasattr(self, 'xml_element'):
            xml_attrs = self.xml_element.attrib

            for variable, value in iter(xml_attrs.items()):
                uri, tag = Element.get_namespace_and_tag(variable)
                tag = tag.replace('-', '_')
                attrs_list.append(tag)
                setattr(self, tag, value)

            self.attrs = attrs_list

        return self.attrs