MainLicence GeneratorContact UsAbout 

1.3 - Format specifications

Oso XML Merge uses format specifications to control how it processes XML files. Unlike XML Schemas, the format specifications Oso XML Merge uses do not define the contents of an XML file. They mostly define how Oso XML Merge identifies XML elements for matching different components of the input files.

Each format specification is stored in its own XML file, located in the local application data folder. The default location of this folder is:


The following snippet shows all possible elements and attributes supported in the format specification files:

    <file name='' filenames='' root=''>
        <element name='' attributes='' comments='' order=''>
            <attribute name=''/>
            <element .../>
A detailed description of each follows below:

• file

The file element is the root element in a format specification file. It therefore follows that Oso XML Merge format specification files can only contain a single XML format specification.

The file element supports the following attributes:

• name
A friendly name for these XML files.

• filenames
A comma separated list of filename wildcards used for matching input files to format specifications when multiple file specifications have the same root elements. This attribute is optional.

• root
The expected root element for these XML files. Oso XML Merge uses this attribute as the first search parameter when looking for the correct format specification for an XML file when loading.
The file element should contain a list of known or expected elements, as well as a special '*' element which is used as a catch all for all unknown elements, and also for identification settings for all elements which haven't been individually configured.

The list of known elements is displayed in the tree on the left side of the Preferences Dialog either immediately below the file entry, or below another element when that parent element is identified with the help of child elements.

• element

Elements hold information about the elements in the corresponding XML file. They support the following attributes:

• name
- The name for this element.

• attributes
A comma separated list of known attributes for this element. These attributes are displayed in the Element Specification Preferences when an element is identified by one or more attribute values. Oso XML Merge will update the attributes list for all elements as it processes XML files.

• comments
Defines how conflicted comments within these elements are automatically resolved (if at all). It should be noted that comments within an XML file which are outside the root element will always use the All Elements rule. This attribute can have one of the following values:

  • DoNothing - Leaves conflicted comments for manual resolving.
  • UseDefault - Uses the rule specified for the all elements item. (The All Elements item cannot contain this value.)
  • Inherit - Uses the rule specified for the element one level up in the XML file.
  • DiscardAll - Throws conflicted comments away.
  • ResolveBase - Automatically keeps the version of the comment in the base file.
  • ResolveLeft - Automatically chooses the comment in the left file.
  • ResolveRight - Automatically resolves to the right file.

• order
This attribute controls whether child elements can be reordered or not when attempting to match elements across the input files. Possible values for this attribute are as follows:

  • UseDefault - Uses the rule specified for the all elements item. (The All Elements item cannot contain this value.)
  • Inherit - Uses the rule specified for the element one level up in the XML file.
  • Random - The order of child nodes does not affect the meaning of the XML data.
  • Sequenced - Child nodes cannot be reordered to help resolve conflicts.
Elements may contain multiple child elements, attributes, or a single content element. The children of an element define how Oso XML Merge identifies elements of that type when processing XML files. The remaining format specification elements described on this page must be children of an element.

• attribute

In the OSO XML Merge format specifications an attribute must be a child of an element. Attributes define the attributes that will be used to identify elements when matching. They support the following attributes themselves:

• name
The name for this attribute. This is the name of the attribute whose value will be used when attempting to uniquely identify elements across the input XML files.

• content

Defines that Oso XML Merge should use the character data content to identify the elements that this content is a child of.

Content data is stripped of whitespace preceeding and following any real character data, so in the following example the two MyElement elements will be considered equal when identifying elements through their character content:

        Some Text

    <MyElement>Some Text</MyElement>

By default, Oso XML Merge will update the format specification for any XML file it loads. This behaviour can be disabled through the File Specification page in the Preferences Dialog.