tagneticconfig Schema

This page documents the elements that are allowed in a tagneticconfig file. Here is the XML Schema file if you would prefer to look at that.

  1. <tagneticconfig>
  2. <include> (optional) (max: unbounded)
      Relative path, relative to tagneticconfig file that defines this element, to another tagneticconfig file that will be included as part of this configuration file.
    1. xs:string
    </include>
  3. <compilation> (optional) (max: unbounded)
    Contains the information on the source directory/files, and information on how to compile them to the destination directory/files.
    1. <source
      1. [ charset=" xs:string " ]
        The charset encoding name. Useful in internationalization support. See Charset JavaDoc for information on valid charset names.
      >
      Specifies the source directory. This MUST be a directory. Individual files are not allowed. Use the filefilter element to choose which files under that directory to process. Also, this MUST be a relative path, relative to the tagneticconfig file that is defining this element.
      1. xs:string
      </source>
    2. <destination
      1. [ charset=" xs:string " ]
        The charset encoding name. Useful in internationalization support. See Charset JavaDoc for information on valid charset names.
      2. [ extension=" xs:string " ]
        Specify a different extension to use for the files that get compiled/transformed and placed in the destination directory. The value of this attribute will replace any text after the last dot of the source file name. Example: to rename any *.xml files to .html, use extension="html" .
      >
      Specifies the destination directory. This MUST be a directory, and it MUST be a relative path, relative to the tagneticconfig file that is defining this element.
      1. xs:string
      </destination>
    3. <filefilter
      1. type=" xs:string (regexp) "
      > (optional)
      Specifies a file name filter on what types of files in the source directory will be compiled/transformed by Tagneto. The type attribute only supports one type of file filters, regular expressions. To only parse files that end in ".html", then the file filter would be \.html$ , NOT *.html. To process all HTML, JS and CSS files, then the following filter: \.htm$|\.html$|\.js$|\.css$ could be used.
      1. xs:string
      </filefilter>
    4. <recursedirectories> (optional)
      1. xs:string (true | false)
      2. (default: true)
      </recursedirectories>
    5. <copynonmatchingfiles> (optional)
      1. xs:string (true | false)
      2. (default: false)
      </copynonmatchingfiles>
    6. <locales> (optional)
        A list of comma-separated locales. The source files will be parsed once for each value in the comma-separated list, and a separate destination directory will be created for each value. For example, if en_US,fr is the locale list, and the destination directory is outdir , then when Tagneto finishes processing, there will be a outdir/en_US directory anda outdir/fr directory. If branch elements are used in the tagneticconfig, the locale directories will be under the branch directories. See the Locale JavaDoc for a discussion of valid locale values.
      1. xs:string
      </locales>
    7. <branch
      1. var=" xs:string "
        The name of the script variable that will hold the branch value.
      > (optional)
      Defines a variable that has certain values. Tagneto will parse the source files once for each value that is specified for the branch variable, and create a destination directory for each value. This allows for a compile/transform-time branch. Useful if the source is basically the same except for some minor differences, like if the source supports generating a web site for two brands, but the only difference between the web site is the branding. Example: a branch variable var="siteBrand" is defined with values of "BrandA" and BrandB". The destination directory is called outdir . Tagneto will parse the source files twice, one time with siteBrand='BrandA' and another time with siteBrand='BrandB'. Tag handlers for the source can use these script variables to do different things. When Tagneto is done processing, then there will be two directories under the destination directory: outdir/BrandA and outdir/BrandB . If locales are defined as part of the compilation tagneticconfig element, then the locale directories will be under the branch directories. Also note that branches can be nested.
      1. <value> (max: unbounded)
        1. xs:string
        </value>
      2. <branch>...
      </branch>
    8. <postfilters> (optional)
      1. <postfilter
        1. [ classname=" xs:string " ]
          A Java class, with full package designation, that implements the org.tagnetic.core.filecontentfilter.FileContentFilter interface. A generic regular expression post filter is supported via org.tagnetic.core.filecontentfilter.RegExpFileContentFilter. In Tagneto's source code, look at src/js/JsLibrarryTagneticConfig.xml for example usage.
        > (max: unbounded)
        A Java class that has the chance to modify the text of a transformed file before it is saved to the destination directory. This allows for source cleanup, comment removal, or final text modification with the benefit of having the fully transformed source available.
        1. <param
          1. name=" xs:string "
          > (optional) (max: unbounded)
          Allows specifying a name/value pair for elements that allow for open-ended configuraiton.
          1. xs:string
          </param>
        </postfilter>
      </postfilters>
    9. <fileoverlays> (optional)
      The list of file overlays to be applied to any matching source files.
      1. <fileoverlay
        1. [ position=" xs:string (before | after) " ]
        > (optional) (max: unbounded)
        A file "overlay" to be applied to source files that match the regular expression specified in the file element. The contents of the overlay file will be placed either before or after the source file (indicated by the position attribute). The overlay file path (the overlay element) MUST be a relative path, relative to tagneticconfig file defining this element.
        1. <file>
          1. xs:string
          </file>
        2. <overlay>
          1. xs:string
          </overlay>
        </fileoverlay>
      </fileoverlays>
    </compilation>
  4. <elementsyntax
    1. [ classname=" xs:string " ]
      The Java class, with full package designation, that implements the TagMatcher interface. If the element syntax pattern is simple enough (clear start and end tokens, very simple attribute and name/value separators, no support for element bodies), then the org.tagnetic.core.parser.tagmatcher.SimpleTagMatcher that is part of Tagneto may be enough. That class is actually used to specify the XML entity-like syntax that is supported in Tagneto. See Tagneto's TagMatchers.xml configuration file for an example usage.
    > (optional) (max: unbounded)
    Specifies a Java class that will provide a syntax for identifying element syntax. This allows for creating tags or elements that don't look like the normal XML syntax. Tagneto comes configured to support the normal XML syntax and a syntax that looks like XML entities. These syntaxes should be enough for most developers, but if not, a Java class that implements the TagMatcher interface can be identified by using this element in a tagneticconfig.
    1. <param
      1. name=" xs:string "
      > (optional) (max: unbounded)
      Allows specifying a name/value pair for elements that allow for open-ended configuraiton.
      1. xs:string
      </param>
    </elementsyntax>
  5. <tags
    1. [ nsprefix=" xs:string " ]
      Defines the namespace prefix that will be part of the tag names. For instance, Tagneto defines some view: namespace tags (like view:include ). In Tagneto's ViewTags.xml , the tags config element has nsprefix="view" .
    2. [ scriptcontextname=" xs:string (default: js)" ]
      A logical name for the script context. Ignore this attribute if using JavaScript as the script language for the tags.
    3. [ scriptcontext=" xs:string (default: org.tagnetic.core.scriptcontext.implementer.javascript.JavaScriptContext)" ]
      The Java class, with full package designation, that implements the org.tagnetic.core.scriptcontext.ScriptContext interface. Used for providing a script execution context for the tags. Ignore this attribute if using JavaScript as the script language for the tags.
    > (optional) (max: unbounded)
    Defines a list of tags that are part of a namespace.
    1. <tag
      1. name=" xs:string "
        The tag (element) name.
      2. classname=" xs:string "
        A Java class, with full package designation, that derives from org.tagnetic.core.framework.Tag. Implements that tag handling behavior.
      3. [ priority=" xs:integer (default: -1)" ]
        The priority of this tag handler. Multiple tag handlers can be specified for each tag name. The normal priority is the first one defined is the first one that gets executed. Use this attribute to change that default ordering. A value of 0 means the tag handler will be called first. If multiple tag handlers are defined with priority 0, then the last one that declares priority 0 will be the first one to be called.
      > (max: unbounded)
      Identifies a tag that will be handled by a Java tag handler.
      1. <attribute
        1. name=" xs:string "
          The name of the attribute.
        2. [ property=" xs:string " ]
          The property on the tag handler's Java class that will be called to set the value that corresponds with this attribute. Uses the Java Beans naming convention. For instance, if the property name is "foo" then the "setFoo()" method will be called on the tag handler. Similarly, if the property is called "alongerfoo", then "setAlongerfoo()" will be called. If the property attribute is not specified, then the name attribute will be used to find the setter on the tag handler Java class.
        3. [ type=" xs:string (path) " ]
          If this type is specified, currently only one value can be used: "path". If type="path" is used, then the attribute value is assumed to be a path relative to the tagneticconfig file defining the attribute.
        4. [ required=" xs:boolean " ]
          Indicates if this attribute is required on the tag when it is used in the source files. If required="true" is used and a source file does not define this attribute when it uses the associated tag, then an exception will be thrown when Tagneto runs.
        5. [ trimdefault=" xs:boolean (default: true)" ]
          Indicates whether the attribute value should have leading and trailing whitespaced trimmed off. The default for all attributes is true, but if that is not desired for a particular tag, then specify trimdefault="false".
        > (optional) (max: unbounded)
        Identifies an attribute that is part of the tag.
        1. xs:string
        </attribute>
      </tag>
    </tags>
  6. </tagneticconfig>
Copyright © 2005 tagnetic.org.