appendAttribute() public method

public appendAttribute ( String name, String _value ) : bc.flash.xml.AsXML
name String
_value String
return bc.flash.xml.AsXML
コード例 #1
0
        private AsXMLElement ExtractXML(XElement node)
        {
            if (node.NodeType == XmlNodeType.Element)
            {
                AsXMLElement element = new AsXMLElement(node.Name.LocalName);

                IEnumerable<XAttribute> attributes = node.Attributes();
                foreach (XAttribute attr in attributes)
                {
                    element.appendAttribute(attr.Name.LocalName, attr.Value);
                }

                IEnumerable<XElement> childs = node.Elements();
                foreach (XElement child in childs)
                {
                    AsXMLElement childElement = ExtractXML(child);
                    if (childElement != null)
                    {
                        element.appendChild(childElement);
                    }
                }

                return element;
            }

            return null;
        }
コード例 #2
0
        private AsXMLElement ExtractXML(XmlNode node)
        {
            if (node.NodeType == XmlNodeType.Element)
            {
                AsXMLElement element = new AsXMLElement(node.Name);

                XmlAttributeCollection attributes = node.Attributes;
                foreach (XmlAttribute attr in attributes)
                {
                    element.appendAttribute(attr.Name, attr.Value);
                }

                XmlNodeList childs = node.ChildNodes;
                foreach (XmlNode child in childs)
                {
                    AsXMLElement childElement = ExtractXML(child);
                    if (childElement != null)
                    {
                        element.appendChild(childElement);
                    }
                }

                return element;
            }

            return null;
        }