The
xmlReader type is used to read an XML document without loading it in memory. The characteristics of this XML document can be read by several WLanguage properties.
Remark: For more details on the declaration of this type of variable and the use of WLanguage properties, see
Declaring a variable.
MyNode is xmlNode
MyNode..Type = XMLTag
MyNode..Name = "MyNode"
MyNode..Text = "Text of node"
Reader is xmlReader = XMLOpenReader("file.xml")
FOR EACH Reader IN-DEPTH
Trace(Reader.Type)
END
VariableReset(Reader) // Close file
Reader2 is xmlReader = XMLOpenReader("file.xml")
FOR EACH x OF Reader2
IF Reader2.Type = XMLReaderStartTag _OR_ Reader2.Type = XMLReaderEmptyElementTag THEN
IF Reader2.Name = "config" THEN
FOR EACH y OF x
Trace(x.Name)
END
END
END
END
VariableReset(Reader2) // Close file
Remarks
Properties specific to the description of xmlReader variables
The following properties can be used to handle an XML document:
| | |
Property name | Type used | Effect |
---|
Attribute | Array of xmlAttribute | Array of XML attributes associated with the node. |
Depth | Integer | Depth of current element in the XML treeview. This property is read-only. |
Name | Unicode string | Name of node. This property is read-only. |
Namespace | xmlNamespace variable | Namespace of node This property is read-only. |
NamespaceDeclared | Array of xmlNamespace | Array of XML namespaces declared by the node. |
Type | Integer | Type of XML node: - XMLReaderNone: The current element does not correspond to a node.
- XMLReaderStartTag: Start of tag.
- XMLReaderEndTag: End of tag.
- XMLReaderEmptyElementTag: Empty tag.
- XMLReaderCDATA: CDATA section.
- XMLReaderComment: Comments.
- XMLReaderEntity: Entity declaration.
- XMLReaderUnknown: Unknown type.
- XMLReaderProcessingInstruction: Processing statement
- XMLReaderEntityReference: Reference to an entity.
- XMLReaderText: Text.
- XMLReaderDocumentType: DOCTYPE declaration.
This property is read-only. |
Value | Unicode string | Value of node. Remark: The references to an entity are automatically interpreted. This property is read-only. |