wwtransform:super

Version

Date

Changes

1.0

2008-03-31

Initial version.

Description

This article focuses on wwtransform:super, a powerful new resource available in ePublisher 2008.1, and demonstrates how its use can simplify extending ePublisher Formats.

wwtransform:super

ePublisher 2008.1 introduces a powerful extension to ePublisher URI Resolvers. wwtransform:super extends the tiered look-up behavior to allow users to import the lower-priority version of the file in addition to specializing some aspect of it in a higher version. Let's look at how it works.

Example

One might imagine a scenario in which we're not quite satisfied with the way that ePublisher writes HTML <table> code. We want to explicitly define how table code is emitted. In the past, we might copy the content.xsl from the ePublisher installation area and place it in one of the override slots, then edit the file as needed. wwtransform:super allows us to override the file in one of the override slots with only the new XSL code we want to execute. We then import the XSL file from the base slot by invoking wwtransform:super. Following are the list of steps necessary to make this work.

  1. Create an XSL file called content.xsl.

  2. Insert it as an override in your project.
  3. Include the line: <xsl:import href="wwtransform:super" /> in the appropriate place for import statements.

  4. Write your wwdoc:Table match template in the file.

Example Implementation

Caveats

ePublisher XSLs make heavy use of parameters. In XSL parameters have to be passed along from function to function. There first template in a call chain which fails to pass the parameters renders the parameters unavailable to any subsequent calls. When implementing overrides, failing to pass parameters along means that you cannot return the processing flow to the base XSL. This is fine, of course, if the omission is intentional and no return to the base processing context is required. Also, as noted above, it is probably best to use wwtransform:super as a Target override, since performing a Save As Stationery will break any usage in the Format override slot.

DevCenter/Documentation/wwtransform:super (last edited 2012-08-29 19:40:25 by JesseWiles)