BinaryReader/BinaryWriter
XML file, and returning the Name and Value property:
Public Sub RdzXML(ByVal xmlfilepath As String)
Dim xmlRdr As XmlTextReader = New XmlTextReader(xmlfilepath)
Do While xmlRdr.Read()
Console.WriteLine(xmlRdr.Name & xmlRdr.Value)
Loop
End Sub
Table 15−32 describes the node types and their equivalent in the W3C DOM. The types are further explained
in the list that follows the table.
Table 15−32: XML Node Types
Node Type XML Value
None 0
Element <name> 1
Attribute Id='123' 2
Text '123' 3
CDATA <![CDATA[]]> 4
EntityReference &foo; 5
Entity <!ENTITY> 6
ProcessingInstruction <?pi test?> 7
Comment <!comment> 8
Document 9
DocumentType <!DOCTYPE> 10
DocumentFragment 11
Notation <!NOTATION> 12
Whitespace Whitespace 13
SignificantWhiteSpace Whitespace between markup in a mixed 14
content model
EndTag </foo> 15
EndEntity Returned when the reader is at the end of 16
the entity replacement as a result of a call
to ExpendEntry
CharacterEntity Returned when the reader has been told to 17
report character entities
• Attribute nodes can have the following child node types: Text and EntityReference. The Attribute
node does not appear as the child node of any other node type. It is not considered a child node of an
Element.
• CDATA sections are used to escape blocks of text that would otherwise be recognized as markup. A
CDATA node cannot have any child nodes. It can appear as the child of the DocumentFragment,
EntityReference, and Element nodes.
• Comment nodes cannot have any child nodes. They can appear as the child of the Document,
DocumentFragment, Element, and EntityReference nodes.
553