EnumerateElements - cXMLDOMDocumentFragment

Provides a way to enumerate through all child elements

Type: Procedure

Parameters: Integer iMsg Handle hoReceiver String sVal1 String sVal2

ParameterDescription
iMsg The message that is sent
hoReceiverThe object that the message is sent to
sVal1Parameter, which you define
sVal2Parameter, which you define


Syntax
Procedure EnumerateElements Integer iMsg Handle hoReceiver String sVal1 String sVal2

Call: Send EnumerateElements iMsg hoReceiver sVal1 sVal2


Description

EnumerateElements provides a way to enumerate through all child elements. For each valid node type the message iMsg is sent to the object hoReceiver. Three parameters are passed to this method: hoNode (the ID of the XML node), sVal1 and sVal2 (which you define). All node objects are created and destroyed as needed.

Example

Procedure ShowAtt handle hoNode integer  iLevel
    Showln iLevel " : " (psName(honode)) " : " (psNodeValue(hoNode))
End_Procedure

Procedure ShowNode handle hoNode string sLevel string sX
    integer i

    ShowLn sLevel " :" (psNodeName(honode))
    Move sLevel to i
    Increment i
    Send EnumerateAttributes of hoNode msg_showAtt  self i
    Send EnumerateElements   of hoNode msg_showNode self i sX
End_Procedure

Procedure ShowAll
    handle hoNode

    Get DocumentElement of hoMyXML to hoNode
    Send ShowNode hoNode 1 ""
End_Procedure

See Also

EnumerateAttributes | EnumerateNodes