public static void DropDocument(XmlSourceInfo firstChild, XmlDocumentLineInfo replaceMent)
 {
     if (firstChild == null)
     {
         return;
     }
     firstChild.SetOwnerDocument(replaceMent);
 }
        public void SetOwnerDocument(XmlDocumentLineInfo newDoc)
        {
            var prev = OwnerDocument as XmlDocumentLineInfo;

            if (prev != newDoc)
            {
                _docLineInfo = newDoc;
            }
        }
        internal LineInfoElementImpl(string prefix, string localname, string nsURI, XmlDocumentLineInfo doc)
            : base(XmlDocumentLineInfo.Intern(prefix), XmlDocumentLineInfo.Intern(localname), XmlDocumentLineInfo.Intern(nsURI), doc.FileDoc)
        {
            var lvar = doc as XmlDocumentLineInfo;

            if (lvar != null)
            {
                _docLineInfo = lvar;
                lvar.CheckNode(this);
            }
            //((XmlDocumentLineInfo)doc).IncrementElementCount();
        }
        public void SetOwnerDocument(XmlDocumentLineInfo newDoc)
        {
            var prev = OwnerDocument as XmlDocumentLineInfo;

            if (prev != newDoc)
            {
                _docLineInfo = newDoc;
            }
            foreach (var v in ChildNodes)
            {
                XmlDocumentLineInfo.DropDocument(v as XmlSourceLineInfo, newDoc);
            }
        }
        public XmlDocumentLineInfo GetReusableDoc()
        {
            var doc = this;

            if (!doc.IsReusableDoc && doc.WasUsed)
            {
                var ndoc = new XmlDocumentLineInfo();
                ndoc.InfoString       = doc.InfoString;
                ndoc.IsFile           = doc.IsFile;
                ndoc.SetNodesReadOnly = doc.SetNodesReadOnly;
                ndoc.IsReusableDoc    = false;
                ndoc.WasUsed          = false;
                doc = ndoc;
                DiscardReaders();
            }
            return(doc);
        }
        public void SetParentFromNode(XmlNode xmlNode)
        {
            XmlNode pn = xmlNode.ParentNode;

            if (pn is LineInfoElementImpl)
            {
                lParent = (LineInfoElementImpl)pn;
                XmlDocumentLineInfo.SuggestLineNo(lParent, this);
            }
            if (!(xmlNode is IXmlLineInfo))
            {
                xmlNode = (XmlNode)lParent;
            }
            if (xmlNode is LineInfoElementImpl)
            {
                LineInfoElementImpl lie = (LineInfoElementImpl)xmlNode;
                lineNumData = lie;
                XmlDocumentLineInfo.SuggestLineNo(lie, this);
            }
        }
        public static XmlReader CreateXmlTextReader(XmlNodeReader nodeReader)
        {
            throw new NotImplementedException();
            // Set the validation settings.
            XmlReaderSettings settings = DefaultSettings; //new XmlReaderSettings();

            if (false)
            {
                XmlDocumentLineInfo doc = new XmlDocumentLineInfo("CreateXmlTextReader for NODE", false);
                doc.Load("books.xml");

                settings.ValidationType = ValidationType.Auto;
                settings.Schemas.Add("urn:bookstore-schema", "books.xsd");
                settings.ValidationEventHandler += ValidationCallBack;

                // Create a validating reader that wraps the XmlNodeReader object.
            }
            XmlReader reader = XmlReader.Create(nodeReader, settings);

            // Parse the XML file.
            return(reader);
            //while (reader.Read()) ;
        }
 internal void writeToLog(string s)
 {
     XmlDocumentLineInfo.DebugWriteLine(s + " on XML node: '" + this + "'");
 }
 public XmlAttributeLineInfo(string prefix, string name, string uri, XmlDocumentLineInfo doc)
     : base(XmlDocumentLineInfo.Intern(prefix), XmlDocumentLineInfo.Intern(name), XmlDocumentLineInfo.Intern(uri), doc.FileDoc)
 {
     docLineInfo = doc;
 }
 public void SetOwnerDocument(XmlDocumentLineInfo elseway)
 {
     throw new NotImplementedException();
 }
 public XmlTextLineInfo(string text, XmlDocumentLineInfo info)
     : base(XmlDocumentLineInfo.Intern(text), info.FileDoc)
 {
     _docLineInfo = info;
 }