XMLNodeType()

Syntax

Result = XMLNodeType(Node)
Description
Returns the type of the given XML node.

Parameters

Node The XML node to use.

Return value

It can be one of the following:

#PB_XML_Root
This is the trees root node. It represents the document itself. This node cannot be created or deleted manually. Inside the root node, there can be only one node of type #PB_XML_Normal and also no plain text. (this is required to be a well-formed XML document)
#PB_XML_Normal
This is a normal node in the tree. It can have a list of attributes and contain text and/or child nodes.
Example: <node attribute="hello"> contained text </node>
#PB_XML_Comment
This node represents a comment. It can have no children or attributes. Its text represents the content of the comment.
Example: <!-- comment text -->
#PB_XML_CData
This is a CData section. A CData section contains only text. Its content is not interpreted by the parser so it can contain unescaped "<" and ">" characters for example. CData sections can be used to include other markup or code inside a document without having to escape all characters that could be interpreted as XML.
Example: <![CDATA[ cdata content ]]>
#PB_XML_DTD
This is a document type declaration (DTD). This library does not use a validating parser, so these declarations are actually ignored when parsing a document. In order to save them back correctly, they are contained within such a DTD node. The text content of the node is the entire DTD tag. It can be read and modified through commands like SetXMLNodeText() and will be written back to the document when exporting/saving without modification. The SetXMLStandalone() command could be useful as well when working with DTDs.
Example: <!DOCTYPE name SYSTEM "external dtd uri">
#PB_XML_Instruction
This node represents a Processing Instruction. Processing Instructions contain information that is intended to be interpreted/executed by the target application. They have a name to specify the content of the instruction and the instruction data which can be accessed with GetXMLNodeText().
Example: <?php if (...) ... ?>
(here "php" is the node name, and the rest up to the "?>" is the node text.)

Supported OS

All

<- XMLNodePath() - XML Index - XMLStatus() ->