Difference between revisions of "XMLMerge"

From GreenVulcano Wiki
Jump to: navigation, search
 
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==

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>