Mono Class Library: System.Xml.XmlWriter Overview | MembersSystem.Xml.XmlWriter.WriteAttributes Method |
Writes the attributes found at the current position of a System.Xml.XmlReader. [Edit]
|
- reader
- A System.Xml.XmlReader from which to copy the attributes. [Edit]
- defattr
- A bool where true specifies to copy the default attributes from reader; otherwise, false. [Edit]
Type Reason ArgumentNullException reader is null. [Edit] InvalidOperationException The XmlWriter.WriteState is WriteState.Closed. [Edit] System.Xml.XmlException reader is not positioned on a node of System.Xml.XmlNodeTypeAttribute, Element, or XmlDeclaration. [Edit]
Operation
If the reader is positioned on an Element or XmlDeclaration node, this method writes all the contained attributes. If the reader is positioned on an Attribute node, this method writes the current attribute, then the rest of the attributes until the closing tag is reached. If the reader is positioned on any other node type, this method throws an exception.This method positions the reader by calling its XmlReader.MoveToFirstAttribute and XmlReader.MoveToNextAttribute methods, and retrieves the value of the attributes by calling the XmlReader.ReadAttributeValue method of the reader.
Note to Inheritors
Override this method to remove any content that would invalidate the document.Usage
Use this method to write all the attributes found at the current position. [Edit]
Namespace: System.Xml
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0