Definition matching

To find the corresponding transformation element for each source format node the following process is followed:

  1. Match the transformation elements by node name (tag)

  2. Match the attributes in the filtered list of transformation elements;

    • search for the first transformation element that has an exact match attribute that matches a node attribute.

    • If no exact match is found, we search for the first transformation element that has a default match attribute.

    • If no default match is found, we search for the first transformation element that only default values attributes or no attributes at all.

  3. When we find a transformation element, we use it to transform the node from source format to target format.

    • HTML to XML: we use the parser defined in Type field of the transformation element to perform the transformation logic.

    • XML to HTML: a single parser is used to perform the transformation. For each XML node it creates the corresponding HTML node by the transformation element that is found for the XML Node. The parser is defined on TransformationSet level(field InDesign Text Parser) and should be always set, the default parser is InDesignTextParser.

  4. If no transformation element is found, the node is skipped and the process continues with its child nodes. Exception are the base formatting tags like em, strong, etc that are handled out of the box together with inline formatting applied through style attribute.

Exception is the tr, th and td transformation elements that do not use the Parser type, because the default TableParser takes care of transforming the whole table.

XML to HTML transformation is performed when saving rich text field value from InDesign. A Tag attribute is set to XML nodes if applicable; it is not present in all cases. In InDesign we have Paragraph Styles, Character Styles, Object Styles, Table Styles, Cell Styles. Tag attribute is set to the XML nodes, for which Export Tag can be set in InDesign. In InDesign CS6 this is ParagraphStyle and CharacterStyle.

The default tag for ParagraphStyle is "p", the default tag for CharacterStyle is "span". When export tag in InDesign is "Automatic", the default tag for the style is set.