Child pages
  • CustomizationGuide
Skip to end of metadata
Go to start of metadata

Customization Guide

This page aims to help you to write mapping definition files. They are really simple to create and test.

Example

Following file is a simple mapping definition file :

(lightbulb) Get the idea ? You specify which schemas/DTD your mappings target, and then you define nodes you'd like to see inside structure view and how they should be displayed.

Format is simple, and editing is even simplier since an XML Schema is provided to allow completion inside IDEA. This schema is explained below.

Mapping definition file schema

  • xstructure
    • Content : container for supported schemas and mapping definitions
    • Attributes :
      • name : a logical name to identify this file. It will be display so user may choose a mapping definition file when several are available.
      • version : release number for this definition file. Mappings definition files are versionned since mappings or supported schemas may be updated.
      • priority : useful when several mapping definition files are available for the same file. They will be sorted by priority, and mappings with lowest priority will be selected by default
      • implType : implementation type. xStructure supports different implementations to resolve nodes. Recommended implementation is default, which is based on regular expressions. You could also used xpath implementation which provides more flexibility but is slower. See ImplementationTypes page for more details about implementation types.
  • supported-schemas
    • Content : container for supported schemas. May contain multiple schema nodes
  • schema
    • Attributes :
      • uri : URI of any supported schema. This may be a DTD location or an XML Schema location.
  • mappings
    • Content : container for mapping definitions
    • Attributes :
      • defaultSkip : specify default skip mode for nodes. When a node is not matched by any mappings, this settings define if it should be displayed or not. This value is overriden by skip attribute of mappings. See this attribute for accepted values
  • mapping
    • Attributes :
      • match : path used to identify which nodes are concerned by this mapping. Path format depends on implementation type. See ImplementationTypes page for more details about implementation types.
      • label : defines how matched nodes should be displayed. This expression is based on node context and typically uses children nodes text or attributes values. If not specified and skip mode is set to none, tag name will be used. Expression format depends on implementation type.
      • tip : defines optional tooltip for matched nodes. This expression is based on node context and typically uses children nodes text or attributes values. Expression format depends on implementation type.
      • skip : specify skip mode for matched nodes, overriding optional defaultSkip attribute of mappings element. Skip mode allows to hide some nodes which don't provide relevant information.

Accepted values for skip/defaultSkip attributes are :

  • none : node is displayed using its label expression (default value)
  • this : node is hidden but its children are displayed by default (according to their mappings). This allows to skip container elements.
  • children : node is displayed buts its children are hidden by default (according to their mappings)
  • all : node and its children are hidden (recursively)
  • No labels