XPath and DocToDOM

The XPath expression is required to complete a query executed against the process data DOM tree. The node returned must have an SCIObjectID attribute. This enables the document to load by the ID and then parsed.

The following function extracts the SCIObjectID attribute from the process data DOM and loads the corresponding document into process data:


DocToDOM (xpath expression [, validate, loadDTD])

You can add additional XPath criteria following the function call to run an XPath query against the document itself.

Additional functions shown in the previous example are:

  • validate – Document validation value. Default value is true. Optional.
  • loadDTD – Determines if the parser loads the DTD, as specified. Default value is true. Optional.

This document shows the XML file used in the following examples:


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE document SYSTEM "examples.dtd">
<Testplan>
 <Test1>
  <Unit_Price>5.25</Unit_Price>
 </Test1>
 <Test2>
  <Customer_ID>3</Customer_ID>
  <Zip>43013</Zip>
  <Entry_Date>2006-10-10</Entry_Date>
 </Test2>
 <Test3>
  <Customer_ID>2</Customer_ID>
  <Quantity>80000</Quantity>
  <Entry_Date>11/2/2006</Entry_Date>
 </Test3>
 <Test4>
  <Customer_ID>5</Customer_ID>
  <SirName>Mr.</SirName>   
  <FirstName>Joe</FirstName> 
  <LastName>Smith</LastName>   
  <Address>555 Main St.</Address>
  <City>Anywhere</City>
  <State>OH</State>
  <Zip>55555</Zip>
  <Phone_Num>555-5632</Phone_Num>
  <Orders_Placed>2</Orders_Placed>
 </Test4>
 <Test5>
  <Customer_ID>5</Customer_ID> 
  <City>Columbus</City>
  <Entry_Date>12/5/2006</Entry_Date>
 </Test5>
 <Test6>
  <Customer_ID>5</Customer_ID> 
 </Test6>
 <Test7>
  <Unit_Price>43.25</Unit_Price>
 </Test7>
 <Test8>
  <Customer_ID>3</Customer_ID>
  <Zip>43013</Zip>
  <Entry_Date>2006-10-10</Entry_Date>
 </Test8> 
 <Test9>
  <Customer_ID>2</Customer_ID>
  <Quantity>80000</Quantity>
 </Test9>
 <Test10>
  <Customer_ID>1</Customer_ID> 
  <City>Columbus</City>
 </Test10>
</Testplan>