ChildNodeCount property: Incoming Business Interlink class
Description
The ChildNodeCount property returns the number of XML child nodes within the element referenced by the BiDocs object. Child nodes include XML elements, comments, and processing instructions.
This property is read-only.
Example
Here is a set of XML request code.
<?xml version="1.0"?>
<postreq>
<email>joe_blow@example.com</email>
<projtitle>
<!--this is a comment line-->
<projsubtitle>first_subtitle</projsubtitle>
<projsubtitle>second_subtitle</projsubtitle>
<projsubtitle>third_subtitle</projsubtitle>
</projtitle>
</postreq>
Here is the XML code that gets the number of nodes within <postreq> and <projtitle>. &count1 is 2, for <email> and <projtitle>, and &count2 is 4, for the three <projsubtitle> nodes and the comment node.
Local BIDocs &rootInDoc, &projtitleDoc;
Local string &blob;
Local number &count1, &count2;
&blob = %Request.GetContentBody();
&rootInDoc = GetBiDoc(&blob);
&postreqDoc = &rootInDoc.GetNode("postreq");
&count1 = &postreqDoc.ChildNodeCount;
&projtitleDoc = &postreqDoc.GetNode("projtitle");
&count2 = &projtitleDoc.ChildNodeCount;