Exemple #1
0
        private void InternalSetName(__XName value)
        {
            // fcku jxml

            // [Fatal Error] :22:5: The element type "ydob" must be terminated by the matching end-tag "</ydob>".
            var old      = "<" + this.Name.LocalName + " ";
            var oldclose = "</" + this.Name.LocalName + ">";

            var str  = this.ToString();
            var fake = "<" + value.LocalName + " " + str.Substring(old.Length, str.Length - old.Length - oldclose.Length)
                       + "</" + value.LocalName + ">";

            var e = (__XElement)(object)__XElement.Parse(fake);



            this.InternalElementName = value;

            e.InternalFixBeforeAdobt();
            //Console.WriteLine("before adobt, add: " + e.InternalToString());
            __adoptNode(e);

            //this.InternalPartialElements.Add(e);
            this.InternalValue.getParentNode().replaceChild(e.InternalValue, this.InternalValue);

            this.InternalValue = e.InternalValue;
        }
        private void InternalSetName(__XName value)
        {
            // fcku jxml

            // [Fatal Error] :22:5: The element type "ydob" must be terminated by the matching end-tag "</ydob>".
            var old = "<" + this.Name.LocalName + " ";
            var oldclose = "</" + this.Name.LocalName + ">";

            var str = this.ToString();
            var fake = "<" + value.LocalName + " " + str.Substring(old.Length, str.Length - old.Length - oldclose.Length)
                + "</" + value.LocalName + ">";

            var e = (__XElement)(object)__XElement.Parse(fake);



            this.InternalElementName = value;

            e.InternalFixBeforeAdobt();
            //Console.WriteLine("before adobt, add: " + e.InternalToString());
            __adoptNode(e);

            //this.InternalPartialElements.Add(e);
            this.InternalValue.getParentNode().replaceChild(e.InternalValue, this.InternalValue);

            this.InternalValue = e.InternalValue;
        }