TWiki> TWiki Web>XMLQueryPlugin? >XmlQueryPluginRecipe1 (2006-02-28, PatrickDiamond? )EditAttach


List all Attachments in the current Web

Annotated XSLT

%XSLTSTART{topic=".*" benchmark="off" cache="on" debug="on"}%
 <xsl:stylesheet version="1.0" xmlns:xsl="">

Required XSL header tag

 <xsl:template match="/twiki">

Match each /twiki item in the XML

 <table border="1">
Output a table tag and the contents of the first row

 <xsl:for-each select="/twiki/web/topic/data/metadata/fileattachment">
Loop over each fileattachment

        <td>[[<xsl:value-of select="../../@web"/>.<xsl:value-of select="../../@topic"/>]]</td>
Extract from the XML element "data" the web and topic attributes

        <td><xsl:value-of select="@name"/></td>
        <td><xsl:value-of select="@user"/></td>
        <td><xsl:value-of select="@comment"/></td>

Output the file attachment attributes of name, user and comment



XmlQuery must be Installed for this demo to work. If %XSLTSTART{}% tag appears XmlQueryPugin is not installed
Topic revision: r7 - 2006-02-28 - 11:17:57 - PatrickDiamond?

This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback
Note: Please contribute updates to this topic on at TWiki:TWiki.XmlQueryPluginRecipe1