Skip to content
may-bee edited this page Sep 25, 2014 · 23 revisions
Table of Contents

XML Plug-in

The CobiGen XML Plug-in currently only provides different merge mechanisms for XML result documents.

Merger extensions

There are two merge strategies for XML documents, which can be configured in the templates.xml:

  • Merge strategy javamerge (merges two XML documents and keeps the existing XML elements on conflicts)

  • Merge strategy javamerge_override (merges two XML documents and overrides the existing XML elements on conflicts)

As XML is a meta-language, it is not possible to compare all the different XML-based languages in a correct semanitcally way. Thus the current merge algorithm is based on some documents, which have been interesting to be merged in the past, like, spring bean specifications and xml specifications of named queries.

The current algorithms looks like this:

  1. If the two elements declare an id attribute

    • If the two elements declare an attribute id

      • the value of the attribute id will be compared and result of the comparison

  2. If the two element’s qualified name is "import"

    • If the two elements declare an attribute resource

      • the value of the attribute resource will be compared and declared as the result of the comparison

  3. If the two element’s qualified name is "query", "property", or "define"

    • If the two elements declare an attribute name

      • the value of the attribute name will be compared and declared as the result of the comparison

  4. If the two element’s qualified name is "transition"

    • If the two elements declare an attribute on

      • the value of the attribute on will be compared and declared as the result of the comparison

  5. If the two element’s qualified name is "outputLabel" or "message"

    • If the two elements declare an attribute for and an attribute value

      • both values will be compared and declared as the result of the comparison

    • If the two elements only declare the attribute for

      • the value of the attribute for will be compared and declared as the result of the comparison

  6. If the two element’s parents are equal

    • the value text value will be compared and result of the comparison

  7. All other elements will only be compared by the precondition (equal node name)

Clone this wiki locally