Xslt filters chains

MVC Web Project defines an extension point to apply XSLT filters. Filters are chained and then stored in a target file.

Extension point com.alveole.studio.xsltfilters enables to define some filter chains. XSLT filters are applied one after the other, extension by extension.

        <!ELEMENT extension (xslt*,targetfile?,targetfilehandler?)>
        <!ATTLIST extension
                point CDATA #REQUIRED
                id    CDATA #REQUIRED
                name  CDATA #IMPLIED>
  • point - must contain com.alveole.studio.xsltfilters
  • id - a required unique identifier of this filter chain. This ID is used when XsltResultHandler is called.
  • name - an optional name of the extension instance.

Extension point contains multiple xslt tag. Each one references an XSLT file to be applied.

        <!ELEMENT xslt (#EMPTY)>
        <!ATTLIST xslt
                xsltfile CDATA #REQUIRED>
  • xsltfile - the path to a XSLT file

Xslt files are applied in cascade. Extension must define either one targetfile or targetfilehandler tag:

        <!ELEMENT targetfile (#EMPTY)>
        <!ATTLIST targetfile
                file CDATA #REQUIRED
                prependfilename CDATA #IMPLIED>
  • file - The name of the target file.
  • prependfilename - true/false, specifies if file must be prepended with project name (enables to make unique names).

For specifying a handler:

        <!ELEMENT targetfilehandler (#EMPTY)>
        <!ATTLIST targetfilehandler
                class CDATA #REQUIRED
                xsltfile CDATA #IMPLIED>
  • class - The class that implements XsltResultHandler.
  • xsltfile - a last XSLT file to apply before saving.