Beispiel #1
0
        private string ConvertUriToFileName(XmlDocument xmlDocument)
        {
            XmlFileInfoDocument document = xmlDocument as XmlFileInfoDocument;
            string fileName = (document == null) ? document.BaseURI : document.FileName;

            return(this.ConvertUriToFileName(fileName));
        }
Beispiel #2
0
        public static void Format(XmlDocument document)
        {
            XmlFileInfoDocument parentNode = document as XmlFileInfoDocument;

            if (parentNode != null)
            {
                new XmlFormatter(parentNode).FormatLoop(parentNode);
            }
        }
Beispiel #3
0
        public static void Format(XmlDocument document)
        {
            XmlFileInfoDocument errorInfoDocument = document as XmlFileInfoDocument;

            if (errorInfoDocument != null)
            {
                XmlFormatter formatter = new XmlFormatter(errorInfoDocument);
                formatter.FormatLoop(errorInfoDocument);
            }
        }
Beispiel #4
0
        private string ConvertUriToFileName(XmlDocument xmlDocument)
        {
            string uri;
            XmlFileInfoDocument errorInfoDocument = xmlDocument as XmlFileInfoDocument;

            if (errorInfoDocument != null)
            {
                uri = errorInfoDocument.FileName;
            }
            else
            {
                uri = errorInfoDocument.BaseURI;
            }

            return(ConvertUriToFileName(uri));
        }
Beispiel #5
0
        private XmlNode CreateCloneInTargetDocument(XmlNode sourceNode)
        {
            XmlNode             node;
            XmlFileInfoDocument targetDocument = this.TargetDocument as XmlFileInfoDocument;

            if (targetDocument != null)
            {
                node = targetDocument.CloneNodeFromOtherDocument(sourceNode);
            }
            else
            {
                XmlReader reader = new XmlTextReader(new StringReader(sourceNode.OuterXml));
                node = this.TargetDocument.ReadNode(reader);
            }
            this.ScrubTransformAttributesAndNamespaces(node);
            return(node);
        }
        private XmlNode CreateCloneInTargetDocument(XmlNode sourceNode)
        {
            XmlFileInfoDocument infoDocument = TargetDocument as XmlFileInfoDocument;
            XmlNode             clonedNode;

            if (infoDocument != null)
            {
                clonedNode = infoDocument.CloneNodeFromOtherDocument(sourceNode);
            }
            else
            {
                XmlReader reader = new XmlTextReader(new StringReader(sourceNode.OuterXml));
                clonedNode = TargetDocument.ReadNode(reader);
            }

            ScrubTransformAttributesAndNamespaces(clonedNode);

            return(clonedNode);
        }
Beispiel #7
0
 private XmlFormatter(XmlFileInfoDocument document)
 {
     this.document         = document;
     this.originalFileName = document.FileName;
 }
Beispiel #8
0
 internal XmlFileInfoAttribute(string prefix, string localName, string namespaceUri, XmlFileInfoDocument document)
     : base(prefix, localName, namespaceUri, document)
 {
     lineNumber   = document.CurrentLineNumber;
     linePosition = document.CurrentLinePosition;
 }
Beispiel #9
0
            internal XmlFileInfoElement(string prefix, string localName, string namespaceUri, XmlFileInfoDocument document)
                : base(prefix, localName, namespaceUri, document)
            {
                lineNumber   = document.CurrentLineNumber;
                linePosition = document.CurrentLinePosition;
                isOriginal   = document.FirstLoad;

                if (document.PreservationProvider != null)
                {
                    preservationDict = document.PreservationProvider.GetDictAtPosition(lineNumber, linePosition - 1);
                }
                if (preservationDict == null)
                {
                    preservationDict = new XmlAttributePreservationDict();
                }
            }
 public XmlNodeException(Exception innerException, XmlNode node)
     : base(innerException.Message, innerException)
 {
     this.lineInfo = node as IXmlLineInfo;
     this.document = node.OwnerDocument as XmlFileInfoDocument;
 }
 public XmlNodeException(string message, XmlNode node)
     : base(message)
 {
     this.lineInfo = node as IXmlLineInfo;
     this.document = node.OwnerDocument as XmlFileInfoDocument;
 }
 public XmlNodeException(string message, XmlNode node)
     : base(message) {
     this.lineInfo = node as IXmlLineInfo;
     this.document = node.OwnerDocument as XmlFileInfoDocument;
 }
 public XmlNodeException(Exception innerException, XmlNode node)
     : base(innerException.Message, innerException) {
     this.lineInfo = node as IXmlLineInfo;
     this.document = node.OwnerDocument as XmlFileInfoDocument;
 }
Beispiel #14
0
 private XmlFormatter(XmlFileInfoDocument document) {
     this.document = document;
     this.originalFileName = document.FileName;
 }
 internal XmlFileInfoAttribute(string prefix, string localName, string namespaceUri, XmlFileInfoDocument document)
     : base(prefix, localName, namespaceUri, document) {
     lineNumber = document.CurrentLineNumber;
     linePosition = document.CurrentLinePosition;
 }
            internal XmlFileInfoElement(string prefix, string localName, string namespaceUri, XmlFileInfoDocument document)
                : base(prefix, localName, namespaceUri, document) {
                lineNumber = document.CurrentLineNumber;
                linePosition = document.CurrentLinePosition;
                isOriginal = document.FirstLoad;

                if (document.PreservationProvider != null) {
                    preservationDict = document.PreservationProvider.GetDictAtPosition(lineNumber, linePosition - 1);
                }
                if (preservationDict == null) {
                    preservationDict = new XmlAttributePreservationDict();
                }
            }