Пример #1
0
    public virtual global::Xml firstElement()
    {
                #line 338 "/opt/haxe/std/Xml.hx"
        if (((this.nodeType != global::Xml.Document) && (this.nodeType != global::Xml.Element)))
        {
                        #line 338 "/opt/haxe/std/Xml.hx"
            throw ((global::System.Exception)(global::haxe.Exception.thrown(global::haxe.lang.Runtime.concat("Bad node type, expected Element or Document but found ", global::_Xml.XmlType_Impl_.toString(this.nodeType)))));
        }

                #line 339 "/opt/haxe/std/Xml.hx"
        {
                        #line 339 "/opt/haxe/std/Xml.hx"
            int _g = 0;
                        #line 339 "/opt/haxe/std/Xml.hx"
            global::Array <object> _g1 = this.children;
                        #line 339 "/opt/haxe/std/Xml.hx"
            while ((_g < _g1.length))
            {
                                #line 339 "/opt/haxe/std/Xml.hx"
                global::Xml child = ((global::Xml)(_g1[_g]));
                                #line 339 "/opt/haxe/std/Xml.hx"
                ++_g;
                if ((child.nodeType == global::Xml.Element))
                {
                                        #line 341 "/opt/haxe/std/Xml.hx"
                    return(child);
                }
            }
        }

                #line 344 "/opt/haxe/std/Xml.hx"
        return(null);
    }
Пример #2
0
 protected static void __hx_ctor__Xml(global::Xml __hx_this, int nodeType)
 {
             #line 398 "/opt/haxe/std/Xml.hx"
     __hx_this.nodeType = nodeType;
     __hx_this.children = new global::Array <object>(new object[] {});
             #line 400 "/opt/haxe/std/Xml.hx"
     __hx_this.attributeMap = new global::haxe.ds.StringMap <string>();
 }
Пример #3
0
 public static string print(global::Xml xml, global::haxe.lang.Null <bool> pretty)
 {
                 #line 35 "/opt/haxe/std/haxe/xml/Printer.hx"
     global::haxe.lang.Null <bool> pretty1 = ((!(pretty.hasValue)) ? (new global::haxe.lang.Null <bool>(false, true)) : (pretty));
     global::haxe.xml.Printer      printer = new global::haxe.xml.Printer((pretty1).@value);
                 #line 37 "/opt/haxe/std/haxe/xml/Printer.hx"
     printer.writeNode(xml, "");
     return(printer.output.b.ToString());
 }
Пример #4
0
    public virtual object elementsNamed(string name)
    {
                #line 318 "/opt/haxe/std/Xml.hx"
        if (((this.nodeType != global::Xml.Document) && (this.nodeType != global::Xml.Element)))
        {
                        #line 318 "/opt/haxe/std/Xml.hx"
            throw ((global::System.Exception)(global::haxe.Exception.thrown(global::haxe.lang.Runtime.concat("Bad node type, expected Element or Document but found ", global::_Xml.XmlType_Impl_.toString(this.nodeType)))));
        }

                #line 319 "/opt/haxe/std/Xml.hx"
        global::Array <object> _g = new global::Array <object>(new object[] {});
        {
                        #line 320 "/opt/haxe/std/Xml.hx"
            int _g1 = 0;
                        #line 320 "/opt/haxe/std/Xml.hx"
            global::Array <object> _g2 = this.children;
                        #line 320 "/opt/haxe/std/Xml.hx"
            while ((_g1 < _g2.length))
            {
                                #line 320 "/opt/haxe/std/Xml.hx"
                global::Xml child = ((global::Xml)(_g2[_g1]));
                                #line 320 "/opt/haxe/std/Xml.hx"
                ++_g1;
                bool tmp = default(bool);
                if ((child.nodeType == global::Xml.Element))
                {
                                        #line 321 "/opt/haxe/std/Xml.hx"
                    if ((child.nodeType != global::Xml.Element))
                    {
                                                #line 321 "/opt/haxe/std/Xml.hx"
                        throw ((global::System.Exception)(global::haxe.Exception.thrown(global::haxe.lang.Runtime.concat("Bad node type, expected Element but found ", global::_Xml.XmlType_Impl_.toString(child.nodeType)))));
                    }

                                        #line 321 "/opt/haxe/std/Xml.hx"
                    tmp = (child.nodeName == name);
                }
                else
                {
                                        #line 321 "/opt/haxe/std/Xml.hx"
                    tmp = false;
                }

                                #line 321 "/opt/haxe/std/Xml.hx"
                if (tmp)
                {
                                        #line 321 "/opt/haxe/std/Xml.hx"
                    _g.push(child);
                }
            }
        }

                #line 319 "/opt/haxe/std/Xml.hx"
        global::Array <object> ret = _g;
                #line 323 "/opt/haxe/std/Xml.hx"
        return(new global::haxe.iterators.ArrayIterator <object>(((global::Array <object>)(ret))));
    }
Пример #5
0
    public static global::Xml createProcessingInstruction(string data)
    {
                #line 228 "/opt/haxe/std/Xml.hx"
        global::Xml xml = new global::Xml(((int)(global::Xml.ProcessingInstruction)));
        {
                        #line 229 "/opt/haxe/std/Xml.hx"
            if (((xml.nodeType == global::Xml.Document) || (xml.nodeType == global::Xml.Element)))
            {
                                #line 229 "/opt/haxe/std/Xml.hx"
                throw ((global::System.Exception)(global::haxe.Exception.thrown(global::haxe.lang.Runtime.concat("Bad node type, unexpected ", global::_Xml.XmlType_Impl_.toString(xml.nodeType)))));
            }

                        #line 229 "/opt/haxe/std/Xml.hx"
            xml.nodeValue = data;
        }

                #line 230 "/opt/haxe/std/Xml.hx"
        return(xml);
    }
Пример #6
0
    public static global::Xml createElement(string name)
    {
                #line 183 "/opt/haxe/std/Xml.hx"
        global::Xml xml = new global::Xml(((int)(global::Xml.Element)));
        {
                        #line 184 "/opt/haxe/std/Xml.hx"
            if ((xml.nodeType != global::Xml.Element))
            {
                                #line 184 "/opt/haxe/std/Xml.hx"
                throw ((global::System.Exception)(global::haxe.Exception.thrown(global::haxe.lang.Runtime.concat("Bad node type, expected Element but found ", global::_Xml.XmlType_Impl_.toString(xml.nodeType)))));
            }

                        #line 184 "/opt/haxe/std/Xml.hx"
            xml.nodeName = name;
        }

                #line 185 "/opt/haxe/std/Xml.hx"
        return(xml);
    }
Пример #7
0
    public virtual void insertChild(global::Xml x, int pos)
    {
                #line 382 "/opt/haxe/std/Xml.hx"
        if (((this.nodeType != global::Xml.Document) && (this.nodeType != global::Xml.Element)))
        {
                        #line 382 "/opt/haxe/std/Xml.hx"
            throw ((global::System.Exception)(global::haxe.Exception.thrown(global::haxe.lang.Runtime.concat("Bad node type, expected Element or Document but found ", global::_Xml.XmlType_Impl_.toString(this.nodeType)))));
        }

                #line 383 "/opt/haxe/std/Xml.hx"
        if ((x.parent != null))
        {
                        #line 384 "/opt/haxe/std/Xml.hx"
            x.parent.children.@remove(x);
        }

                #line 386 "/opt/haxe/std/Xml.hx"
        this.children.insert(pos, x);
        x.parent = this;
    }
Пример #8
0
    public virtual bool removeChild(global::Xml x)
    {
                #line 367 "/opt/haxe/std/Xml.hx"
        if (((this.nodeType != global::Xml.Document) && (this.nodeType != global::Xml.Element)))
        {
                        #line 367 "/opt/haxe/std/Xml.hx"
            throw ((global::System.Exception)(global::haxe.Exception.thrown(global::haxe.lang.Runtime.concat("Bad node type, expected Element or Document but found ", global::_Xml.XmlType_Impl_.toString(this.nodeType)))));
        }

                #line 368 "/opt/haxe/std/Xml.hx"
        if (this.children.@remove(x))
        {
                        #line 369 "/opt/haxe/std/Xml.hx"
            x.parent = null;
            return(true);
        }

                #line 372 "/opt/haxe/std/Xml.hx"
        return(false);
    }
Пример #9
0
    public virtual void addChild(global::Xml x)
    {
                #line 354 "/opt/haxe/std/Xml.hx"
        if (((this.nodeType != global::Xml.Document) && (this.nodeType != global::Xml.Element)))
        {
                        #line 354 "/opt/haxe/std/Xml.hx"
            throw ((global::System.Exception)(global::haxe.Exception.thrown(global::haxe.lang.Runtime.concat("Bad node type, expected Element or Document but found ", global::_Xml.XmlType_Impl_.toString(this.nodeType)))));
        }

                #line 355 "/opt/haxe/std/Xml.hx"
        if ((x.parent != null))
        {
                        #line 356 "/opt/haxe/std/Xml.hx"
            x.parent.removeChild(x);
        }

                #line 358 "/opt/haxe/std/Xml.hx"
        this.children.push(x);
        x.parent = this;
    }
Пример #10
0
    public virtual object elements()
    {
                #line 308 "/opt/haxe/std/Xml.hx"
        if (((this.nodeType != global::Xml.Document) && (this.nodeType != global::Xml.Element)))
        {
                        #line 308 "/opt/haxe/std/Xml.hx"
            throw ((global::System.Exception)(global::haxe.Exception.thrown(global::haxe.lang.Runtime.concat("Bad node type, expected Element or Document but found ", global::_Xml.XmlType_Impl_.toString(this.nodeType)))));
        }

                #line 309 "/opt/haxe/std/Xml.hx"
        global::Array <object> _g = new global::Array <object>(new object[] {});
                #line 309 "/opt/haxe/std/Xml.hx"
        {
                        #line 309 "/opt/haxe/std/Xml.hx"
            int _g1 = 0;
                        #line 309 "/opt/haxe/std/Xml.hx"
            global::Array <object> _g2 = this.children;
                        #line 309 "/opt/haxe/std/Xml.hx"
            while ((_g1 < _g2.length))
            {
                                #line 309 "/opt/haxe/std/Xml.hx"
                global::Xml child = ((global::Xml)(_g2[_g1]));
                                #line 309 "/opt/haxe/std/Xml.hx"
                ++_g1;
                                #line 309 "/opt/haxe/std/Xml.hx"
                if ((child.nodeType == global::Xml.Element))
                {
                                        #line 309 "/opt/haxe/std/Xml.hx"
                    _g.push(child);
                }
            }
        }

                #line 309 "/opt/haxe/std/Xml.hx"
        global::Array <object> ret = _g;
        return(new global::haxe.iterators.ArrayIterator <object>(((global::Array <object>)(ret))));
    }
Пример #11
0
        public virtual void writeNode(global::Xml @value, string tabs)
        {
            unchecked {
                                #line 50 "/opt/haxe/std/haxe/xml/Printer.hx"
                switch (@value.nodeType)
                {
                case 0:
                {
                                                #line 68 "/opt/haxe/std/haxe/xml/Printer.hx"
                    this.output.b.Append(((string)(global::Std.@string(global::haxe.lang.Runtime.concat(tabs, "<")))));
                    {
                                                        #line 69 "/opt/haxe/std/haxe/xml/Printer.hx"
                        if ((@value.nodeType != global::Xml.Element))
                        {
                                                                #line 69 "/opt/haxe/std/haxe/xml/Printer.hx"
                            throw ((global::System.Exception)(global::haxe.Exception.thrown(global::haxe.lang.Runtime.concat("Bad node type, expected Element but found ", global::_Xml.XmlType_Impl_.toString(@value.nodeType)))));
                        }

                                                        #line 69 "/opt/haxe/std/haxe/xml/Printer.hx"
                        this.output.b.Append(((string)(global::Std.@string(@value.nodeName))));
                    }

                                                #line 70 "/opt/haxe/std/haxe/xml/Printer.hx"
                    {
                                                        #line 70 "/opt/haxe/std/haxe/xml/Printer.hx"
                        object attribute = @value.attributes();
                                                        #line 70 "/opt/haxe/std/haxe/xml/Printer.hx"
                        while (global::haxe.lang.Runtime.toBool(global::haxe.lang.Runtime.callField(attribute, "hasNext", 407283053, null)))
                        {
                                                                #line 70 "/opt/haxe/std/haxe/xml/Printer.hx"
                            string attribute1 = global::haxe.lang.Runtime.toString(global::haxe.lang.Runtime.callField(attribute, "next", 1224901875, null));
                            this.output.b.Append(((string)(global::Std.@string(global::haxe.lang.Runtime.concat(global::haxe.lang.Runtime.concat(" ", attribute1), "=\"")))));
                                                                #line 72 "/opt/haxe/std/haxe/xml/Printer.hx"
                            {
                                                                        #line 72 "/opt/haxe/std/haxe/xml/Printer.hx"
                                string input = global::StringTools.htmlEscape(@value.@get(attribute1), new global::haxe.lang.Null <bool>(true, true));
                                                                        #line 72 "/opt/haxe/std/haxe/xml/Printer.hx"
                                this.output.b.Append(((string)(global::Std.@string(input))));
                            }

                                                                #line 73 "/opt/haxe/std/haxe/xml/Printer.hx"
                            this.output.b.Append(((string)("\"")));
                        }
                    }

                                                #line 75 "/opt/haxe/std/haxe/xml/Printer.hx"
                    if (this.hasChildren(@value))
                    {
                                                        #line 76 "/opt/haxe/std/haxe/xml/Printer.hx"
                        this.output.b.Append(((string)(">")));
                        if (this.pretty)
                        {
                                                                #line 77 "/opt/haxe/std/haxe/xml/Printer.hx"
                            this.output.b.Append(((string)("\n")));
                        }

                                                        #line 78 "/opt/haxe/std/haxe/xml/Printer.hx"
                        {
                                                                #line 78 "/opt/haxe/std/haxe/xml/Printer.hx"
                            if (((@value.nodeType != global::Xml.Document) && (@value.nodeType != global::Xml.Element)))
                            {
                                                                        #line 78 "/opt/haxe/std/haxe/xml/Printer.hx"
                                throw ((global::System.Exception)(global::haxe.Exception.thrown(global::haxe.lang.Runtime.concat("Bad node type, expected Element or Document but found ", global::_Xml.XmlType_Impl_.toString(@value.nodeType)))));
                            }

                                                                #line 78 "/opt/haxe/std/haxe/xml/Printer.hx"
                            int _g_current = 0;
                                                                #line 78 "/opt/haxe/std/haxe/xml/Printer.hx"
                            global::Array <object> _g_array = @value.children;
                                                                #line 78 "/opt/haxe/std/haxe/xml/Printer.hx"
                            while ((_g_current < _g_array.length))
                            {
                                                                        #line 78 "/opt/haxe/std/haxe/xml/Printer.hx"
                                global::Xml child = ((global::Xml)(_g_array[_g_current++]));
                                this.writeNode(child, ((this.pretty) ? (global::haxe.lang.Runtime.concat(tabs, "\t")) : (tabs)));
                            }
                        }

                                                        #line 81 "/opt/haxe/std/haxe/xml/Printer.hx"
                        this.output.b.Append(((string)(global::Std.@string(global::haxe.lang.Runtime.concat(tabs, "</")))));
                        {
                                                                #line 82 "/opt/haxe/std/haxe/xml/Printer.hx"
                            if ((@value.nodeType != global::Xml.Element))
                            {
                                                                        #line 82 "/opt/haxe/std/haxe/xml/Printer.hx"
                                throw ((global::System.Exception)(global::haxe.Exception.thrown(global::haxe.lang.Runtime.concat("Bad node type, expected Element but found ", global::_Xml.XmlType_Impl_.toString(@value.nodeType)))));
                            }

                                                                #line 82 "/opt/haxe/std/haxe/xml/Printer.hx"
                            this.output.b.Append(((string)(global::Std.@string(@value.nodeName))));
                        }

                                                        #line 83 "/opt/haxe/std/haxe/xml/Printer.hx"
                        this.output.b.Append(((string)(">")));
                        if (this.pretty)
                        {
                                                                #line 84 "/opt/haxe/std/haxe/xml/Printer.hx"
                            this.output.b.Append(((string)("\n")));
                        }
                    }
                    else
                    {
                                                        #line 86 "/opt/haxe/std/haxe/xml/Printer.hx"
                        this.output.b.Append(((string)("/>")));
                        if (this.pretty)
                        {
                                                                #line 87 "/opt/haxe/std/haxe/xml/Printer.hx"
                            this.output.b.Append(((string)("\n")));
                        }
                    }

                                                #line 67 "/opt/haxe/std/haxe/xml/Printer.hx"
                    break;
                }


                case 1:
                {
                                                #line 90 "/opt/haxe/std/haxe/xml/Printer.hx"
                    if (((@value.nodeType == global::Xml.Document) || (@value.nodeType == global::Xml.Element)))
                    {
                                                        #line 90 "/opt/haxe/std/haxe/xml/Printer.hx"
                        throw ((global::System.Exception)(global::haxe.Exception.thrown(global::haxe.lang.Runtime.concat("Bad node type, unexpected ", global::_Xml.XmlType_Impl_.toString(@value.nodeType)))));
                    }

                                                #line 90 "/opt/haxe/std/haxe/xml/Printer.hx"
                    string nodeValue = @value.nodeValue;
                    if ((nodeValue.Length != 0))
                    {
                                                        #line 92 "/opt/haxe/std/haxe/xml/Printer.hx"
                        {
                                                                #line 92 "/opt/haxe/std/haxe/xml/Printer.hx"
                            string input1 = global::haxe.lang.Runtime.concat(tabs, global::StringTools.htmlEscape(nodeValue, default(global::haxe.lang.Null <bool>)));
                                                                #line 92 "/opt/haxe/std/haxe/xml/Printer.hx"
                            this.output.b.Append(((string)(global::Std.@string(input1))));
                        }

                                                        #line 93 "/opt/haxe/std/haxe/xml/Printer.hx"
                        if (this.pretty)
                        {
                                                                #line 93 "/opt/haxe/std/haxe/xml/Printer.hx"
                            this.output.b.Append(((string)("\n")));
                        }
                    }

                                                #line 89 "/opt/haxe/std/haxe/xml/Printer.hx"
                    break;
                }


                case 2:
                {
                                                #line 52 "/opt/haxe/std/haxe/xml/Printer.hx"
                    this.output.b.Append(((string)(global::Std.@string(global::haxe.lang.Runtime.concat(tabs, "<![CDATA[")))));
                    {
                                                        #line 53 "/opt/haxe/std/haxe/xml/Printer.hx"
                        if (((@value.nodeType == global::Xml.Document) || (@value.nodeType == global::Xml.Element)))
                        {
                                                                #line 53 "/opt/haxe/std/haxe/xml/Printer.hx"
                            throw ((global::System.Exception)(global::haxe.Exception.thrown(global::haxe.lang.Runtime.concat("Bad node type, unexpected ", global::_Xml.XmlType_Impl_.toString(@value.nodeType)))));
                        }

                                                        #line 53 "/opt/haxe/std/haxe/xml/Printer.hx"
                        this.output.b.Append(((string)(global::Std.@string(@value.nodeValue))));
                    }

                                                #line 54 "/opt/haxe/std/haxe/xml/Printer.hx"
                    this.output.b.Append(((string)("]]>")));
                    if (this.pretty)
                    {
                                                        #line 55 "/opt/haxe/std/haxe/xml/Printer.hx"
                        this.output.b.Append(((string)("\n")));
                    }

                                                #line 51 "/opt/haxe/std/haxe/xml/Printer.hx"
                    break;
                }


                case 3:
                {
                                                #line 57 "/opt/haxe/std/haxe/xml/Printer.hx"
                    if (((@value.nodeType == global::Xml.Document) || (@value.nodeType == global::Xml.Element)))
                    {
                                                        #line 57 "/opt/haxe/std/haxe/xml/Printer.hx"
                        throw ((global::System.Exception)(global::haxe.Exception.thrown(global::haxe.lang.Runtime.concat("Bad node type, unexpected ", global::_Xml.XmlType_Impl_.toString(@value.nodeType)))));
                    }

                                                #line 57 "/opt/haxe/std/haxe/xml/Printer.hx"
                    string commentContent = @value.nodeValue;
                    commentContent = new global::EReg("[\n\r\t]+", "g").replace(commentContent, "");
                                                #line 59 "/opt/haxe/std/haxe/xml/Printer.hx"
                    commentContent = global::haxe.lang.Runtime.concat(global::haxe.lang.Runtime.concat("<!--", commentContent), "-->");
                    this.output.b.Append(((string)(global::Std.@string(tabs))));
                                                #line 61 "/opt/haxe/std/haxe/xml/Printer.hx"
                    {
                                                        #line 61 "/opt/haxe/std/haxe/xml/Printer.hx"
                        string input2 = commentContent.Trim();
                                                        #line 61 "/opt/haxe/std/haxe/xml/Printer.hx"
                        this.output.b.Append(((string)(global::Std.@string(input2))));
                    }

                                                #line 62 "/opt/haxe/std/haxe/xml/Printer.hx"
                    if (this.pretty)
                    {
                                                        #line 62 "/opt/haxe/std/haxe/xml/Printer.hx"
                        this.output.b.Append(((string)("\n")));
                    }

                                                #line 56 "/opt/haxe/std/haxe/xml/Printer.hx"
                    break;
                }


                case 4:
                {
                                                #line 99 "/opt/haxe/std/haxe/xml/Printer.hx"
                    {
                                                        #line 99 "/opt/haxe/std/haxe/xml/Printer.hx"
                        if (((@value.nodeType == global::Xml.Document) || (@value.nodeType == global::Xml.Element)))
                        {
                                                                #line 99 "/opt/haxe/std/haxe/xml/Printer.hx"
                            throw ((global::System.Exception)(global::haxe.Exception.thrown(global::haxe.lang.Runtime.concat("Bad node type, unexpected ", global::_Xml.XmlType_Impl_.toString(@value.nodeType)))));
                        }

                                                        #line 99 "/opt/haxe/std/haxe/xml/Printer.hx"
                        this.output.b.Append(((string)(global::Std.@string(global::haxe.lang.Runtime.concat(global::haxe.lang.Runtime.concat("<!DOCTYPE ", @value.nodeValue), ">")))));
                    }

                                                #line 100 "/opt/haxe/std/haxe/xml/Printer.hx"
                    if (this.pretty)
                    {
                                                        #line 100 "/opt/haxe/std/haxe/xml/Printer.hx"
                        this.output.b.Append(((string)("\n")));
                    }

                                                #line 98 "/opt/haxe/std/haxe/xml/Printer.hx"
                    break;
                }


                case 5:
                {
                                                #line 96 "/opt/haxe/std/haxe/xml/Printer.hx"
                    {
                                                        #line 96 "/opt/haxe/std/haxe/xml/Printer.hx"
                        if (((@value.nodeType == global::Xml.Document) || (@value.nodeType == global::Xml.Element)))
                        {
                                                                #line 96 "/opt/haxe/std/haxe/xml/Printer.hx"
                            throw ((global::System.Exception)(global::haxe.Exception.thrown(global::haxe.lang.Runtime.concat("Bad node type, unexpected ", global::_Xml.XmlType_Impl_.toString(@value.nodeType)))));
                        }

                                                        #line 96 "/opt/haxe/std/haxe/xml/Printer.hx"
                        this.output.b.Append(((string)(global::Std.@string(global::haxe.lang.Runtime.concat(global::haxe.lang.Runtime.concat("<?", @value.nodeValue), "?>")))));
                    }

                                                #line 97 "/opt/haxe/std/haxe/xml/Printer.hx"
                    if (this.pretty)
                    {
                                                        #line 97 "/opt/haxe/std/haxe/xml/Printer.hx"
                        this.output.b.Append(((string)("\n")));
                    }

                                                #line 95 "/opt/haxe/std/haxe/xml/Printer.hx"
                    break;
                }


                case 6:
                {
                                                #line 64 "/opt/haxe/std/haxe/xml/Printer.hx"
                    if (((@value.nodeType != global::Xml.Document) && (@value.nodeType != global::Xml.Element)))
                    {
                                                        #line 64 "/opt/haxe/std/haxe/xml/Printer.hx"
                        throw ((global::System.Exception)(global::haxe.Exception.thrown(global::haxe.lang.Runtime.concat("Bad node type, expected Element or Document but found ", global::_Xml.XmlType_Impl_.toString(@value.nodeType)))));
                    }

                                                #line 64 "/opt/haxe/std/haxe/xml/Printer.hx"
                    int _g_current1 = 0;
                                                #line 64 "/opt/haxe/std/haxe/xml/Printer.hx"
                    global::Array <object> _g_array1 = @value.children;
                                                #line 64 "/opt/haxe/std/haxe/xml/Printer.hx"
                    while ((_g_current1 < _g_array1.length))
                    {
                                                        #line 64 "/opt/haxe/std/haxe/xml/Printer.hx"
                        global::Xml child1 = ((global::Xml)(_g_array1[_g_current1++]));
                        this.writeNode(child1, tabs);
                    }

                                                #line 64 "/opt/haxe/std/haxe/xml/Printer.hx"
                    break;
                }
                }
            }
                        #line default
        }
Пример #12
0
        public virtual bool hasChildren(global::Xml @value)
        {
            unchecked {
                                #line 115 "/opt/haxe/std/haxe/xml/Printer.hx"
                {
                                        #line 115 "/opt/haxe/std/haxe/xml/Printer.hx"
                    if (((@value.nodeType != global::Xml.Document) && (@value.nodeType != global::Xml.Element)))
                    {
                                                #line 115 "/opt/haxe/std/haxe/xml/Printer.hx"
                        throw ((global::System.Exception)(global::haxe.Exception.thrown(global::haxe.lang.Runtime.concat("Bad node type, expected Element or Document but found ", global::_Xml.XmlType_Impl_.toString(@value.nodeType)))));
                    }

                                        #line 115 "/opt/haxe/std/haxe/xml/Printer.hx"
                    int _g_current = 0;
                                        #line 115 "/opt/haxe/std/haxe/xml/Printer.hx"
                    global::Array <object> _g_array = @value.children;
                                        #line 115 "/opt/haxe/std/haxe/xml/Printer.hx"
                    while ((_g_current < _g_array.length))
                    {
                                                #line 115 "/opt/haxe/std/haxe/xml/Printer.hx"
                        global::Xml child = ((global::Xml)(_g_array[_g_current++]));
                        switch (child.nodeType)
                        {
                        case 0:
                        case 1:
                        {
                                                                #line 118 "/opt/haxe/std/haxe/xml/Printer.hx"
                            return(true);
                        }


                        case 2:
                        case 3:
                        {
                                                                #line 120 "/opt/haxe/std/haxe/xml/Printer.hx"
                            if (((child.nodeType == global::Xml.Document) || (child.nodeType == global::Xml.Element)))
                            {
                                                                        #line 120 "/opt/haxe/std/haxe/xml/Printer.hx"
                                throw ((global::System.Exception)(global::haxe.Exception.thrown(global::haxe.lang.Runtime.concat("Bad node type, unexpected ", global::_Xml.XmlType_Impl_.toString(child.nodeType)))));
                            }

                                                                #line 120 "/opt/haxe/std/haxe/xml/Printer.hx"
                            if ((child.nodeValue.TrimStart().Length != 0))
                            {
                                                                        #line 121 "/opt/haxe/std/haxe/xml/Printer.hx"
                                return(true);
                            }

                                                                #line 120 "/opt/haxe/std/haxe/xml/Printer.hx"
                            break;
                        }


                        default:
                        {
                                                                #line 123 "/opt/haxe/std/haxe/xml/Printer.hx"
                            break;
                        }
                        }
                    }
                }

                                #line 126 "/opt/haxe/std/haxe/xml/Printer.hx"
                return(false);
            }
                        #line default
        }
Пример #13
0
    public override object __hx_setField(string field, int hash, object @value, bool handleProperties)
    {
        unchecked {
                        #line 82 "/opt/haxe/std/Xml.hx"
            switch (hash)
            {
            case 364006368:
            {
                                        #line 82 "/opt/haxe/std/Xml.hx"
                this.attributeMap = ((global::haxe.ds.StringMap <string>)(global::haxe.ds.StringMap <object> .__hx_cast <string>(((global::haxe.ds.StringMap)(@value)))));
                                        #line 82 "/opt/haxe/std/Xml.hx"
                return(@value);
            }


            case 1886001471:
            {
                                        #line 82 "/opt/haxe/std/Xml.hx"
                this.children = ((global::Array <object>)(global::Array <object> .__hx_cast <object>(((global::Array)(@value)))));
                                        #line 82 "/opt/haxe/std/Xml.hx"
                return(@value);
            }


            case 1836975402:
            {
                                        #line 82 "/opt/haxe/std/Xml.hx"
                this.parent = ((global::Xml)(@value));
                                        #line 82 "/opt/haxe/std/Xml.hx"
                return(@value);
            }


            case 1441685007:
            {
                                        #line 82 "/opt/haxe/std/Xml.hx"
                if (handleProperties)
                {
                                                #line 82 "/opt/haxe/std/Xml.hx"
                    this.set_nodeValue(global::haxe.lang.Runtime.toString(@value));
                                                #line 82 "/opt/haxe/std/Xml.hx"
                    return(@value);
                }
                else
                {
                                                #line 82 "/opt/haxe/std/Xml.hx"
                    this.nodeValue = global::haxe.lang.Runtime.toString(@value);
                                                #line 82 "/opt/haxe/std/Xml.hx"
                    return(@value);
                }
            }


            case 1920782701:
            {
                                        #line 82 "/opt/haxe/std/Xml.hx"
                if (handleProperties)
                {
                                                #line 82 "/opt/haxe/std/Xml.hx"
                    this.set_nodeName(global::haxe.lang.Runtime.toString(@value));
                                                #line 82 "/opt/haxe/std/Xml.hx"
                    return(@value);
                }
                else
                {
                                                #line 82 "/opt/haxe/std/Xml.hx"
                    this.nodeName = global::haxe.lang.Runtime.toString(@value);
                                                #line 82 "/opt/haxe/std/Xml.hx"
                    return(@value);
                }
            }


            case 1988514268:
            {
                                        #line 82 "/opt/haxe/std/Xml.hx"
                this.nodeType = ((int)(global::haxe.lang.Runtime.toInt(@value)));
                                        #line 82 "/opt/haxe/std/Xml.hx"
                return(@value);
            }


            default:
            {
                                        #line 82 "/opt/haxe/std/Xml.hx"
                return(base.__hx_setField(field, hash, @value, handleProperties));
            }
            }
        }
                #line default
    }