/// <summary> /// Creates an XmlDeclaration node with the specified values. /// </summary> /// <param name="version">The version must be "1.0".</param> /// <param name="encoding">The value of the encoding attribute. This is the encoding that is used when you save the XmlDocument to a file or a stream.</param> /// <param name="standalone">The value must be either "yes" or "no". If this is a null reference (Nothing in Visual Basic) or String.Empty, the Save method does not write a standalone attribute on the XML declaration.</param> /// <returns>The new XmlDeclaration node.</returns> public override XmlDeclaration CreateXmlDeclaration(string version, string encoding, string standalone) { LineInfoDeclaration td = new LineInfoDeclaration(version, encoding, standalone, this); IXmlLineInfo lineInfo = this.reader as IXmlLineInfo; if (lineInfo != null && lineInfo.HasLineInfo()) { td.SetLineInfo(lineInfo.LineNumber, lineInfo.LinePosition); } return(td); }
/// <summary> /// Creates an XmlDeclaration node with the specified values. /// </summary> /// <param name="version">The version must be "1.0".</param> /// <param name="encoding">The value of the encoding attribute. This is the encoding that is used when you save the XmlDocument to a file or a stream.</param> /// <param name="standalone">The value must be either "yes" or "no". If this is a null reference (Nothing in Visual Basic) or String.Empty, the Save method does not write a standalone attribute on the XML declaration.</param> /// <returns>The new XmlDeclaration node.</returns> public override XmlDeclaration CreateXmlDeclaration(string version, string encoding, string standalone) { LineInfoDeclaration td = new LineInfoDeclaration(version, encoding, standalone, this); IXmlLineInfo lineInfo = this.reader as IXmlLineInfo; if (lineInfo != null && lineInfo.HasLineInfo()) { td.SetLineInfo(lineInfo.LineNumber, lineInfo.LinePosition); } return td; }