Simen,
This is my maverick.xsl file that adds a view named
"authentication" to every protected command.
<command name="..."
protected="true">
...
</command>
But yes, i think it would make sense to modify view
lookup code to search from amongst global view definitions as well. Would it
break anything?
with best wishes,
Taavi
|
<?xml version='1.0'?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" version="1.0" indent="yes"/> <!-- First of all, copy the root and apply-templates --> <xsl:template match="/"> <xsl:copy> <!-- this copies the attributes(if any) of the root element --> <xsl:copy-of select="@*"/> <xsl:apply-templates/> </xsl:copy> </xsl:template> <!-- This will match any other elements, copy them and their attribute nodes and apply-templates --> <xsl:template match="*"> <xsl:copy> <!-- this copies the attributes(if any) of the element --> <xsl:copy-of select="@*"/> <xsl:apply-templates/> </xsl:copy> </xsl:template> <!-- This will add authentication view to every command that is defined with protected='true' attribute --> <xsl:template match="[EMAIL PROTECTED]'true']"> <command> <!-- this copies across elementA's attributes --> <xsl:copy-of select="@*"/> <xsl:apply-templates/> <view name="authentication" ref="authentication"/> </command> </xsl:template> </xsl:stylesheet>