GetNextXmlDoc method: XmlDocFactory class
Syntax
GetNextXmlDoc(nodeName)
Description
Use the GetNextXmlDoc method to retrieve the next XML subtree matching the given nodeName parameter.
The node name can be a single name, or a list of names separated by a forward slash. For example:
-
"Transaction" returns an XML subtree with Transaction as the root.
-
"Transaction/Date" returns an XML subtree in which Date has a parent node Transaction.
Matching occurs when a node name in the input string matches all of the characters in the nodeName parameter. For example:
-
"Trans" matches nodes in the XML string with those leading characters. For example: Transaction, Transparent, and Transport.
-
"Trans/Date" matches all Date nodes in the input string that have a parent like Transaction, Transparent, or Transport.
Finally, the wildcard * matches any node. Therefore, "Trans/Date/*" matches any node that has a parent matching Date, which in turn has a parent matching Trans.
Parameters
| Parameter | Description |
|---|---|
|
nodeName |
A case-sensitive string containing the identifier for the nodes to find |
Returns
An XmlDoc object containing a matching XML subtree, in which case, the IsNull property of the XmlDoc object is set to False.
Otherwise, when nothing is found, the IsNull property of the XmlDoc object is set to True.
Example
Local XmlDocFactory &theXmlDocFactory;
Local XmlDoc &theXmlDoc;
Local string &findString = "Transaction";
&theXmlDocFactory = CreateXmlDocFactory();
&returnbool = &theXmlDocFactory.SetStringToParse(&inputXmlString);
&theXmlDoc = &theXmlDocFactory.GetNextXmlDoc(&findString);
While ( Not &theXmlDoc.IsNull)
rem do something with the XmlDoc;
&theXmlDoc = &theXmlDocFactory.GetNextXmlDoc(&findString);
End-While;
Related Topics