×
Menu
Index

Change the context using Nodes

 

When multiple Tools in a row should be used to copy elements in the same (other) context, we can use a Node to change the context. In the previous example a number of elements where copied from Insured to Driver.
 
<CustomerDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://SoftRules.com/CustomerDocument.xsd">
     <CustomerWrapper>
          <Insured>
               <ID>69866</ID>
               <Firstname>John</Firstname>
               <SirName>Tapscott</SirName>
               <Street>Steele Street</Street>
               <HouseNumber>1362</HouseNumber>
               <Zipcode>60187</Zipcode>
               <Town>Wheaton</Town>
               <EmailAddress>jtapscott@softrules.com</EmailAdress>
          </Insured>
     </CustomerWrapper>
     <Contract>
          <Policy>
               <MotorVehicle>
                    <Driver>
                         <Firstname/>
                         <SirName/>
                         <Street/>
                         <HouseNumber/>
                         <Zipcode/>
                         <Town/>
                         <EmailAddress/>
                    </Driver>
               </MotorVehicle>
          </Policy>
     </Contract>
</CustomerDocument>
 
In the example Assignments where used that all used the same Alt. path (./Policy/MotorVehicle/Driver/Firstname). In stead of this solution we can place one or more Nodes.
 
Example using one Node.
 
 
The Alt. path in the Assignments should be empty.
 
Example with multiple Nodes:
 
 
The last example is the most easy to read and is therefore best to use.