Skip to main content
A Open Source Solution
Home Download Support Configuration Development ImagoX

Assuming that the XML file is as follows:


<?xml version="1.0"?>
<document xmlns:imago="http://xenei.org/imago/2002" >
    <imago:counter/>
</document>

					

The method of counter usage depends upon the configuration style. If configured using the Launcher style the following XSL would list the count twice. The first one would update it and the second would simply display it.


<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0"
    xmlns:launcher="xalan://org.xenei.imago.extensions.Launcher"
    xmlns:imago="http://xenei.org/imago/2002"
    extension-element-prefixes="xcounter"
>
<xsl:template match="document">
    <xsl:apply-templates />
</xsl:template>

<xsl:template match="imago:counter">
    <launcher:launch launcher:class="Counter" launcher:method="update" format="text" />
    <launcher:launch launcher:class="Counter" launcher:method="read" format="text"/>
</xsl:template>
</xsl:stylesheet>

					

An alternative to the XSLT above is the imago.properties style configuration. Using the same XML file this transform will produce the same results. However it will take longer to execute.


<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0"
    xmlns:xcounter="xalan://org.xenei.imagox.counter.ImagoCounter"
    xmlns:imago="http://xenei.org/imago/2002"
    extension-element-prefixes="xcounter"
>
<xsl:template match="document">
    <xsl:apply-templates />
</xsl:template>

<xsl:template match="imago:counter">
    <xcounter:update format="text" /> <!-- update and display -->
    <xcounter:read format="text" /> <!-- display again -->
</xsl:template>
</xsl:stylesheet>

					

All trademarks and copyrights are the property of their respective owners.
Copyright © 2002-2004 by Xenei.com, All Rights Reserved
OpenSource.org
AnyBrowser.org
Xenei.org - Open Source Solutions