Difference between revisions of "XMLMerge"

From GreenVulcano Wiki
Jump to: navigation, search
(Created page with "==Description== The element provides the configuration parameters to manage XML documenti merging. Contains a list of MergeInfo elements, the first one defines th...")
 
 
(One intermediate revision by the same user not shown)
Line 3: Line 3:
  
 
Contains a list of [[#MergeInfo|MergeInfo]] elements, the first one defines the target document on which merge the data.
 
Contains a list of [[#MergeInfo|MergeInfo]] elements, the first one defines the target document on which merge the data.
 +
 +
Is used in [[DBOBuilder]] of DataHandler.
  
 
==MergeInfo==
 
==MergeInfo==
Line 44: Line 46:
 
with the following configuration:
 
with the following configuration:
 
<syntaxhighlight lang="xml">
 
<syntaxhighlight lang="xml">
<Merge>
+
<XMLMerge>
 
     <MergeInfo source="document1"/>
 
     <MergeInfo source="document1"/>
 
     <MergeInfo source="document2"
 
     <MergeInfo source="document2"
Line 52: Line 54:
 
               xpath-source="/doc3/element"
 
               xpath-source="/doc3/element"
 
               xpath-dest="/doc" />
 
               xpath-dest="/doc" />
</Merge>
+
</XMLMerge>
 
</syntaxhighlight>
 
</syntaxhighlight>
  

Latest revision as of 17:16, 18 February 2016

Description

The element provides the configuration parameters to manage XML documenti merging.

Contains a list of MergeInfo elements, the first one defines the target document on which merge the data.

Is used in DBOBuilder of DataHandler.

MergeInfo

Defines the information for retrieving some XML Nodes from a document and past them on a target document.

Its attributes are:

Attribute Type Description
source required Source document name.
xpath-source optional Source document XPath selector.
xpath-dest optional Destination document parent Node's XPath selector.

Example

As an example lets have 'document1':

<doc>
    <element>some text</element>
</doc>

and 'document2':

<doc2>
    <element>some text 2</element>
    <other-element>some other text</other-element>
</doc2>

and 'document3':

<doc3>
    <element>some text 3</element>
    <other-element>some other text</other-element>
</doc3>

with the following configuration:

<XMLMerge>
    <MergeInfo source="document1"/>
    <MergeInfo source="document2"
               xpath-source="/doc2/element"
               xpath-dest="/doc" />
    <MergeInfo source="document3"
               xpath-source="/doc3/element"
               xpath-dest="/doc" />
</XMLMerge>

we get as output the following XML document:

<doc>
    <element>some text</element>
    <element>some text 2</element>
    <element>some text 3</element>
</doc>