DOMToDoc() function

Move a part of XML from Process Data to Primary Document
Mirjana's picture

DOMToDoc function - take a specific node from Process Data

Request

Take UM element from Process Data and put it into PrimaryDocument with DOMToDoc() function.
 
Process Data
 
<?xml version="1.0" encoding="UTF-8"?>
<ProcessData>
          <PrimaryDocument SCIObjectID="MIRJANA:node1:1316a763640:145462"/>
          <UM>
                   <T1>aaa</T1>
                   <T2>bbb</T2>
          </UM>
          <Other>ggg</Other>
</ProcessData>
 
Primary Document after the operation should be:
 
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<UM>
          <T1>aaa</T1>
          <T2>bbb</T2>
</UM>
 
1. DOMToDoc function
 
 
DOMToDoc function setting
 

<assign to="." from="DOMToDoc(//*[name() = 'UM'], 'PrimaryDocument', 'no', 'UM')"></assign>

 … or even more simple …

 <assign to="." from="DOMToDoc(//UM,'PrimaryDocument','no', 'UM')"></assign>

 
2. XML Encoder
 
 
<operation name="XML Encoder">
          <participant name="XMLEncoder"/>
          <output message="XMLEncoderTypeInputMessage">
                   <assign to="." from="*"/>
                   <assign to="mode">process_data_to_document</assign>
                   <assign to="root_element">UM</assign>
                   <assign to="xPath">//UM/*</assign>
          </output>
          <input message="inmsg">
                   <assign to="." from="*"/>
          </input>
</operation>
 
 
 
 
 
 

 

Syndicate content