NodeType property: Incoming Business Interlink class

Description

The NodeType property returns the type of an XML tag within a BiDocs object as an integer. The values are:

Value Description

1

Element (a normal XML tag)

7

Processing instruction

8

Comment

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> <!--this is a comment--> 
      <projtitle> 
         <projsubtitle>first_subtitle</projsubtitle> 
         <projsubtitle>second_subtitle</projsubtitle> 
         <projsubtitle>third_subtitle</projsubtitle> 
      </projtitle> 
   </postreq>

Here is the PeopleCode that gets types: &xmlprocType is 7 for processing instruction, postreqDoc is 1 for element, and commentType is 8 for comment.

Local BIDocs &rootInDoc, &postreqDoc, &commentDoc; 
Local number &xmlprocType, &postreqType, &commentDoc; 
Local string &blob; 
&blob = %Request.GetContentBody(); 
/* <?xml version="1.0"?> */ 
&rootInDoc = GetBiDoc(&blob); 
&xmlprocType = &rootInDoc.NodeType; 
 
/* <postreq> */ 
&postreqDoc = &rootInDoc.GetNode(1); 
&postreqType = &postreqDoc.NodeType; 
 
/* <!--this is a comment--> */ 
&commentDoc = &postreqDoc.GetNode(2); 
&commentType = &commentDoc.NodeType;