get xml representation of data
@param {String} data
@member KISSY
768419
function (data) {
            // already a xml
            if (data.documentElement) {
                return data;
            }
            var xml;
            try {
                // Standard
                if (win.DOMParser) {
                    xml = new DOMParser().parseFromString(data, 'text/xml');
                } else {
                    // IE
                    /*global ActiveXObject*/
                    xml = new ActiveXObject('Microsoft.XMLDOM');
                    xml.async = false;
                    xml.loadXML(data);
                }
            } catch (e) {
                logger.error('parseXML error :');
                logger.error(e);
                xml = undef;
            }
            if (!xml || !xml.documentElement || xml.getElementsByTagName('parsererror').length) {
                util.error('Invalid XML: ' + data);
            }
            return xml;
        }
211940
function(result) {
    var oResult = {},
        schema = this.responseSchema;
        
    try {
        // Loop through each data field in each result using the schema
        for(var m = schema.fields.length-1; m >= 0 ; m--) {
            var field = schema.fields[m];
            var key = (lang.isValue(field.key)) ? field.key : field;
            var data = null;

            if(this.useXPath) {
                data = YAHOO.util.DataSource._getLocationValue(field, result);
            }
            else {
                // Values may be held in an attribute...
                var xmlAttr = result.attributes.getNamedItem(key);
                if(xmlAttr) {
                    data = xmlAttr.value;
                }
                // ...or in a node
                else {
                    var xmlNode = result.getElementsByTagName(key);
                    if(xmlNode && xmlNode.item(0)) {
                        var item = xmlNode.item(0);
                        // For IE, then DOM...
                        data = (item) ? ((item.text) ? item.text : (item.textContent) ? item.textContent : null) : null;
                        // ...then fallback, but check for multiple child nodes
                        if(!data) {
                            var datapieces = [];
                            for(var j=0, len=item.childNodes.length; j<len; j++) {
                                if(item.childNodes[j].nodeValue) {
                                    datapieces[datapieces.length] = item.childNodes[j].nodeValue;
                                }
                            }
                            if(datapieces.length > 0) {
                                data = datapieces.join("");
                            }
                        }
                    }
                }
            }
            
            
            // Safety net
            if(data === null) {
                   data = "";
            }
            // Backward compatibility
            if(!field.parser && field.converter) {
                field.parser = field.converter;
                YAHOO.log("The field property converter has been deprecated" +
                        " in favor of parser", "warn", this.toString());
            }
            var parser = (typeof field.parser === 'function') ?
                field.parser :
                DS.Parser[field.parser+''];
            if(parser) {
                data = parser.call(this, data);
            }
            // Safety measure
            if(data === undefined) {
                data = null;
            }
            oResult[key] = data;
        }
    }
    catch(e) {
        YAHOO.log("Error while parsing XML result: " + e.message);
    }

    return oResult;
}
1074126
function processGraph(data) {
  let dataset = {
    '@default': []
  };

  let subjects = data.subjects,
    htmlMapper = n => {
      let div = n.ownerDocument.createElement('div');
      div.appendChild(n.cloneNode(true));
      return div.innerHTML;
    };

  Object.keys(subjects).forEach(subject => {
    let predicates = subjects[subject].predicates;
    Object.keys(predicates).forEach(predicate => {
      // iterate over objects
      let objects = predicates[predicate].objects;
      for (let oi = 0; oi < objects.length; ++oi) {
        let object = objects[oi];

        // create RDF triple
        let triple = {};

        // add subject & predicate
        triple.subject = {
          type: subject.indexOf('_:') === 0 ? 'blank node' : 'IRI',
          value: subject
        };
        triple.predicate = {
          type: predicate.indexOf('_:') === 0 ? 'blank node' : 'IRI',
          value: predicate
        };
        triple.object = {};

        // serialize XML literal
        let value = object.value;
        // !!! TODO: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
        // The below actually most likely does NOT work.
        // In most usage contexts this will be an HTML DOM, passing it to xmldom's XMLSerializer
        // will cause it to call .toString() on all the nodes it finds — this only works inside
        // xmldom.
        if (object.type === RDF_XML_LITERAL) {
          // initialize XMLSerializer
          let serializer = new XMLSerializer();
          value = Array.from(object.value)
            .map(n => serializer.serializeToString(n))
            .join('');
          triple.object.datatype = RDF_XML_LITERAL;
        }
        // serialise HTML literal
        else if (object.type === RDF_HTML_LITERAL) {
          value = Array.from(object.value)
            .map(htmlMapper)
            .join('');
          triple.object.datatype = RDF_HTML_LITERAL;
        }
        // object is an IRI
        else if (object.type === RDF_OBJECT) {
          if (object.value.indexOf('_:') === 0)
            triple.object.type = 'blank node';
          else triple.object.type = 'IRI';
        } else {
          // object is a literal
          triple.object.type = 'literal';
          if (object.type === RDF_PLAIN_LITERAL) {
            if (object.language) {
              triple.object.datatype = RDF_LANGSTRING;
              triple.object.language = object.language;
            } else {
              triple.object.datatype = XSD_STRING;
            }
          } else {
            triple.object.datatype = object.type;
          }
        }
        triple.object.value = value;

        // add triple to dataset in default graph
        dataset['@default'].push(triple);
      }
    });
  });

  return dataset;
}
1197967
static private function _data_to_xml($data, $item = 'item', $id = 'id', $content = '')
    {
        foreach ($data as $key => $val) {
            is_numeric($key) && $key = "{$item} {$id}=\"{$key}\"";
            $content .= "<{$key}>";
            if (is_array($val) || is_object($val)) {
                $content .= self::_data_to_xml($val);
            } elseif (is_numeric($val)) {
                $content .= $val;
            } else {
                $content .= '<![CDATA[' . preg_replace("/[\\x00-\\x08\\x0b-\\x0c\\x0e-\\x1f]/", '', $val) . ']]>';
            }
            list($_key, ) = explode(' ', $key . ' ');
            $content .= "</$_key>";
        }
        return $content;
    }
730020
function (data) {
            var tag = data.tag;
            var el = '<' + tag + '>';

            if(data.text && data.text.trim()) {
                el += data.text.trim();
            } else {
                _.each(data.getchildren(), function (child) {
                    el += platformConfig.eltreeToXmlString(child);
                });
            }

            el += '</' + tag + '>';
            return el;
        }
636314
protected static function arrayToXML($data, &$xml = null){

            if($xml === null)
                $xml = new \SimpleXMLElement("<?xml version=\"1.0\"?><nondb></nondb>");
            foreach($data as $k=>$v){
                if(is_array($v)){
                    $sub = $xml->addChild("$k");
                    self::arrayToXML($v, $sub);
                }else{
                    $xml->addChild("$k", htmlspecialchars("$v"));
                }
            }

            return $xml->asXML();

        }
274653
function xmlNodeToString(xmlNode) {
        try {
            // Gecko- and Webkit-based browsers (Firefox, Chrome), Opera.
            return (new XMLSerializer()).serializeToString(xmlNode);
        }
        catch (e) {
            try {
                // Internet Explorer.
                return xmlNode.xml;
            }
            catch (e) {
                //Other browsers without XML Serializer
                console.log('WARNING: XMLSerializer not supported');
            }
        }
        return false;
    }
1363888
public static String toLog(XmlProperty data) {
         if (data.channels == null) {
            return data.getName() + "(" + data.getOwner() + ")";
        } else {
            return data.getName() + "(" + data.getOwner() + ")"
                    + (data.channels);
        }
    }
1065255
function (data) {
    var schema = this.schema;
    if (typeof data === 'string') { return data; }
    if (this.isSingleProperty) { return stringifyProperty(data, schema); }
    data = stringifyProperties(data, schema);
    return styleParser.stringify(data);
  }
609173
function (nodeData, options) {

    var makeNode = function (name, content, attributes, level, hasSubNodes) {

        var indentValue = options.indent !== undefined ? options.indent : '\t';
        var indent = options.prettyPrint ? '\n' + new Array(level).join(indentValue) : '';
        if (options.removeIllegalNameCharacters) {
            name = name.replace(elementReplace, '_');
        }

        var node = [indent, '<', name, (attributes || '')];
        if (content && content.length > 0) {
            node.push('>');
            node.push(content);
            if(hasSubNodes) node.push(indent);
            node.push('</');
            node.push(name);
            node.push('>');
        } else {
            node.push('/>');
        }
        return node.join('');
    };

    return (function fn(nodeData, nodeDescriptor, level) {
        var type = typeof nodeData;
        if ((Array.isArray) ? Array.isArray(nodeData) : nodeData instanceof Array) {
            type = 'array';
        } else if (nodeData instanceof Date) {
            type = 'date';
        }

        switch (type) {
            //if value is an array create child nodes from values
            case 'array':
                var ret = [];
                nodeData.map(function (v) {
                    ret.push(fn(v, 1, level + 1));
                    //entries that are values of an array are the only ones that can be special node descriptors
                });
                if(options.prettyPrint) ret.push('\n');
                return ret.join('');
            case 'date':
                // cast dates to ISO 8601 date (soap likes it)
                return nodeData.toJSON ? nodeData.toJSON() : nodeData + '';
            case 'object':
                if (nodeDescriptor === 1 && nodeData.name) {
                    var content = [], attributes = [], c = '';

                    if (nodeData.attrs) {
                        if (typeof nodeData.attrs !== 'object') {
                            // attrs is a string, etc. - just use it as an attribute
                            attributes.push(' ');
                            attributes.push(nodeData.attrs);
                        } else {
                            for (var key in nodeData.attrs) {
                                var value = nodeData.attrs[key];
                                attributes.push(' ');
                                attributes.push(key);
                                attributes.push('="');
                                attributes.push(options.escape ? esc(value) : value);
                                attributes.push('"');
                            }
                        }
                    }

                    //later attributes can be added here
                    if (typeof nodeData.value !== 'undefined') {
                        c = '' + nodeData.value;
                        content.push(options.escape ? esc(c) : c);
                    } else if (typeof nodeData.text !== 'undefined') {
                        c = '' + nodeData.text;
                        content.push(options.escape ? esc(c) : c);
                    }

                    if (nodeData.children) {
                        content.push(fn(nodeData.children, 0, level + 1));
                    }

                    return makeNode(nodeData.name, content.join(''), attributes.join(''), level, !!nodeData.children);
                } else {
                    var nodes = [];
                    for (var name in nodeData) {
                        nodes.push(makeNode(name, fn(nodeData[name], 0, level + 1), null, level + 1));
                    }
                    if(options.prettyPrint && nodes.length > 0) nodes.push('\n');
                    return nodes.join('');
                }
            /* falls through */
            case 'function':
                return nodeData();
            default:
                return options.escape ? esc(nodeData) : '' + nodeData;
        }
    }(nodeData, 0, 0));
}
932670
function model (xml) {
  var path = ''
  var cache = {}
  xml = xml && typeof xml === 'string' ? xml.replace(/[\n\r]/gi, '') : ''

  return {
    tagValue: (tag, attribute) => {
      if (!Array.isArray(tag)) {
        tag = [tag]
      }

      path = tag.join('_') + '_' + (attribute || '')

      if (typeof cache[path] === 'undefined') {
        cache[path] = extract(xml, tag, attribute)
        if (typeof cache[path] === 'string' && hasTags(cache[path])) {
          cache[path] = model(cache[path])
        }
      }

      return cache[path]
    },
    tagGroup: (tag) => {
      return extractGroup(xml, tag)
    }
  }
}
69952
function ( sData )
	{
		if ( sData.indexOf('&') === -1 )
		{
			return sData;
		}

		var n = document.createElement('div');

		return sData.replace( /&([^\s]*?);/g, function( match, match2 ) {
			if ( match.substr(1, 1) === '#' )
			{
				return String.fromCharCode( Number(match2.substr(1)) );
			}
			else
			{
				n.innerHTML = match;
				return n.childNodes[0].nodeValue;
			}
		} );
	}
330795
function child_data(parent, name) {
  var node     = child_by_name(parent, name)
  if (!node) return "";
  var children = node.children;
  if (!children.length) return "";
  return children.join("");
}
876710
function parse_xlml_data(xml, ss, data, cell/*:any*/, base, styles, csty, row, arrayf, o) {
	var nf = "General", sid = cell.StyleID, S = {}; o = o || {};
	var interiors = [];
	var i = 0;
	if(sid === undefined && row) sid = row.StyleID;
	if(sid === undefined && csty) sid = csty.StyleID;
	while(styles[sid] !== undefined) {
		if(styles[sid].nf) nf = styles[sid].nf;
		if(styles[sid].Interior) interiors.push(styles[sid].Interior);
		if(!styles[sid].Parent) break;
		sid = styles[sid].Parent;
	}
	switch(data.Type) {
		case 'Boolean':
			cell.t = 'b';
			cell.v = parsexmlbool(xml);
			break;
		case 'String':
			cell.t = 's'; cell.r = xlml_fixstr(unescapexml(xml));
			cell.v = xml.indexOf("<") > -1 ? unescapexml(ss) : cell.r;
			break;
		case 'DateTime':
			if(xml.slice(-1) != "Z") xml += "Z";
			cell.v = (parseDate(xml) - new Date(Date.UTC(1899, 11, 30))) / (24 * 60 * 60 * 1000);
			if(cell.v !== cell.v) cell.v = unescapexml(xml);
			else if(cell.v<60) cell.v = cell.v -1;
			if(!nf || nf == "General") nf = "yyyy-mm-dd";
			/* falls through */
		case 'Number':
			if(cell.v === undefined) cell.v=+xml;
			if(!cell.t) cell.t = 'n';
			break;
		case 'Error': cell.t = 'e'; cell.v = RBErr[xml]; if(o.cellText !== false) cell.w = xml; break;
		default: cell.t = 's'; cell.v = xlml_fixstr(ss||xml); break;
	}
	safe_format_xlml(cell, nf, o);
	if(o.cellFormula !== false) {
		if(cell.Formula) {
			var fstr = unescapexml(cell.Formula);
			/* strictly speaking, the leading = is required but some writers omit */
			if(fstr.charCodeAt(0) == 61 /* = */) fstr = fstr.slice(1);
			cell.f = rc_to_a1(fstr, base);
			delete cell.Formula;
			if(cell.ArrayRange == "RC") cell.F = rc_to_a1("RC:RC", base);
			else if(cell.ArrayRange) {
				cell.F = rc_to_a1(cell.ArrayRange, base);
				arrayf.push([safe_decode_range(cell.F), cell.F]);
			}
		} else {
			for(i = 0; i < arrayf.length; ++i)
				if(base.r >= arrayf[i][0].s.r && base.r <= arrayf[i][0].e.r)
					if(base.c >= arrayf[i][0].s.c && base.c <= arrayf[i][0].e.c)
						cell.F = arrayf[i][1];
		}
	}
	if(o.cellStyles) {
		interiors.forEach(function(x) {
			if(!S.patternType && x.patternType) S.patternType = x.patternType;
		});
		cell.s = S;
	}
	if(cell.StyleID !== undefined) cell.ixfe = cell.StyleID;
}
691944
function data(element) {
            var options = {}
            Util.each(element.attributes, function(attribute) {
                var ma = /data-(.+)/.exec(attribute.name)
                if (!ma) return

                var value = attribute.value
                try {
                    /* jshint evil:true */
                    options[ma[1]] = /^\s*[\[{]/.test(value) ?
                        eval('(function(){ return Array.prototype.slice.call(arguments)[0] })(' + value + ')') :
                        value
                } catch (error) {
                    options[ma[1]] = value
                }

                if (options[ma[1]] === 'true') options[ma[1]] = true
                if (options[ma[1]] === 'false') options[ma[1]] = false
            })
            return options
        }
1226439
public function to_xml($data){
        if(!is_array($data) || count($data) <= 0) throw new \Exception('xml data exception!');
        $xml = "<xml>";
        foreach ($data as $key=>$val){
            if (is_numeric($val)){
                $xml.="<".$key.">".$val."</".$key.">";
            }else{
                $xml.="<".$key."><![CDATA[".$val."]]></".$key.">";
            }
        }
        $xml.="</xml>";
        return $xml;
    }
300130
function (data) {
    this.variationCount = -1;
    this.xml[0].children[this.testIdx].children.push({
      name: 'testcase',
      children: [],
      attrs: {
        classname: this.xml[0].children[this.testIdx].attrs.name,
        name: data.name
      }
    });

    return this;
  }