|
Summary
Use these Templates to format xml for documentation.
These Temlates are easy to use.
<xsl:call-template name=formatxml> <xsl:with-param name=selnode select=./> </xsl:call-template>
The only required Parameter is selnode whichis the node you wish to select.
Here is an alternate version with all the params except indent.
<xsl:call-template name=formatxml>
<xsl:with-param name=selnode/> <xsl:with-param name=template-style>font:small 'Verdana';</xsl:with-param> <xsl:with-param name=punctuation-style>color:blue;</xsl:with-param> <xsl:with-param name=node-name-style>color:#990000;</xsl:with-param> <xsl:with-param name=comment-style>color:gray;</xsl:with-param> <xsl:with-param name=pi-style>color:green;</xsl:with-param> <xsl:with-param name=attr-value-style>color:black;</xsl:with-param> <xsl:with-param name=attr-name-style>color:red</xsl:with-param>
</xsl:call-template>
The indent Parameter needs to be changed in the template itself as it is recursive.
<xsl:for-each select=$selnode/node()> <xsl:call-template name=formatxml> <xsl:with-param name=selnode select=./> <xsl:with-param name=indent select=concat(number('2'),'em;')/> </xsl:call-template> </xsl:for-each>
the number 2 is the value you will want to change. Em's will work better across platforms and screen resolutions.
|