Hi i am trying to get the files which have type html. I am getting it fine. but my problem when there are not files with html it shows empty. but i want to display some message like "no htmls were submitted". i would have used counter variable in normal programming languages. here i am unable to do it please help me solve this. thanks
NOTE: xslt 1.0 is needed.
xml:
<?xml version="1.0" encoding="UTF-8"?>
<Files>
<Path class="com.interwoven.cssdk.filesys.CSAreaRelativePath" path="MS/homedemo.html" type="html" />
<Path class="com.interwoven.cssdk.filesys.CSAreaRelativePath" path="MS/test125.html" type="html" />
<Path class="com.interwoven.cssdk.filesys.CSAreaRelativePath" path="iwov-resources/css/akz.css" type="css" />
<Path class="com.interwoven.cssdk.filesys.CSAreaRelativePath" path="iwov-resources/css/animate.css" type="css" />
<Path class="com.interwoven.cssdk.filesys.CSAreaRelativePath" path="iwov-resources/css/base.css" type="css" />
<Path class="com.interwoven.cssdk.filesys.CSAreaRelativePath" path="iwov-resources/css/font-awesome-ie7.css" type="css" />
</Files>
xslt:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<p>
<xsl:apply-templates select="//Files" />
</p>
</html>
</xsl:template>
<xsl:template match="//Files">
<h1 style="background: #979797;border-radius: 5px;color: #FFF;text-shadow: 1px 1px 1px #000;padding: 5px;font-size:16px;">US files are now live and you can access them using the following URLs:</h1>
<ol>
<xsl:for-each select="//Files/Path">
<xsl:variable name="type">
<xsl:choose>
<xsl:when test="@type">
<xsl:value-of select="@type" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="'html'" />
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="path" select="@path" />
<xsl:choose>
<xsl:when test="$type='html'">
<li>
<a class="iw-base-link">
<xsl:attribute name="href">
<xsl:value-of select="$path"/>
</xsl:attribute>
<xsl:value-of select="$path" />
</a>
</li>
</xsl:when>
</xsl:choose>
</xsl:for-each>
</ol>
</xsl:template>
</xsl:stylesheet>
When we have type html files then show below thing:
US files are now live and you can access them using the following URLs:
1.MS/homedemo.html
2.MS/test125.html
When we don't have type html files then show below thing:
US files are now live and you can access them using the following URLs:
NO html files were submitted.