private XmlNode CreateCloneInTargetDocument(XmlNode sourceNode) { XmlFileInfoDocument fileInfoDocument = this.TargetDocument as XmlFileInfoDocument; XmlNode node = fileInfoDocument == null?this.TargetDocument.ReadNode((XmlReader) new XmlTextReader((TextReader) new StringReader(sourceNode.OuterXml))) : fileInfoDocument.CloneNodeFromOtherDocument(sourceNode); this.ScrubTransformAttributesAndNamespaces(node); return(node); }
public static void Format(XmlDocument document) { XmlFileInfoDocument document1 = document as XmlFileInfoDocument; if (document1 == null) { return; } new XmlFormatter(document1).FormatLoop((XmlNode)document1); }
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, (XmlDocument)document) { this.lineNumber = document.CurrentLineNumber; this.linePosition = document.CurrentLinePosition; }
internal XmlFileInfoElement(string prefix, string localName, string namespaceUri, XmlFileInfoDocument document) : base(prefix, localName, namespaceUri, (XmlDocument)document) { this.lineNumber = document.CurrentLineNumber; this.linePosition = document.CurrentLinePosition; this.isOriginal = document.FirstLoad; if (document.PreservationProvider != null) { this.preservationDict = document.PreservationProvider.GetDictAtPosition(this.lineNumber, this.linePosition - 1); } if (this.preservationDict != null) { return; } this.preservationDict = new XmlAttributePreservationDict(); }
internal XmlFileInfoElement(string prefix, string localName, string namespaceUri, XmlFileInfoDocument document) : base(prefix, localName, namespaceUri, (XmlDocument)document) { this.lineNumber = document.CurrentLineNumber; this.linePosition = document.CurrentLinePosition; this.isOriginal = document.FirstLoad; if (document.PreservationProvider != null) this.preservationDict = document.PreservationProvider.GetDictAtPosition(this.lineNumber, this.linePosition - 1); if (this.preservationDict != null) return; this.preservationDict = new XmlAttributePreservationDict(); }
private string ConvertUriToFileName(XmlDocument xmlDocument) { XmlFileInfoDocument fileInfoDocument = xmlDocument as XmlFileInfoDocument; return(this.ConvertUriToFileName(fileInfoDocument == null ? fileInfoDocument.BaseURI : fileInfoDocument.FileName)); }
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; }