| IdGeneratorTransformer.java | Class | A Transformer for adding a URL-encoded 'id' attribute to a node, whose value
is determined by the string value of another node.
For example, if we were parsing XML like:
<section>
<title>Blah blah
....
</section>
We could add an 'id' attribute to the 'section' element with a transformer
configured as follows:
<map:transformer name="idgen"
src="org.apache.cocoon.transformation.IdGeneratorTransformer">
<element>/document/body//*[local-name() = 'section']</element>
<id>title/text()</id>
</map:transformer>
The 'element' parameter is an XPath expression identifying candidates for
having an id added.
The 'id' parameter is an XPath relative to each found 'element', and
specifies a string to use as the id attribute value. |