No Records in XSLT

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
<pre><PROJECTS>
<PROJECT>
<SEARCHINFO_ID>
<PROJECTNUMBER>
<PROJECTNAME>
<PROJECTDESC>
<PROJECT_STATUS_CODE>ACTIVE</PROJECT_STATUS_CODE>
<OPPORTUNITYNUMBER/>
<OPPORTUNITYNAME/>
<OPPORTUNITYDESC/>
</PROJECT>
<PROJECT>
<SEARCHINFO_ID>
<PROJECTNUMBER>
<PROJECTNAME>
<PROJECTDESC>
<PROJECT_STATUS_CODE>Open</PROJECT_STATUS_CODE>
<OPPORTUNITYNUMBER/>
<OPPORTUNITYNAME/>
<OPPORTUNITYDESC/>
</PROJECT>
</PROJECTS>[/code]
Hello,

I am writing an XSLT which will display the results in html. I am trying to check for no records in the xslt it self. The top one is the xml and below one is the xslt which i am writing. I am confused how to check the No records?

<pre> <xsl:template match="/
<xsl:apply-templates></xsl:apply-templates>
</xsl:template>

<xsl:template match="norecords
<xsl:value-of select="text()"/>
</xsl:template>
<xsl:template match="//PROJECTS
<div width="100%" class ="myprojectstitle
My Projects

<div class="myprojects
<ul type="disc" id="ulMyProjects
<xsl:for-each select="//PROJECTS/PROJECT
<xsl:choose>
<xsl:when test="OPPORTUNITYNAME !=
<li class="liMyOpportunity
//anchor tag

</xsl:when>
<xsl:otherwise>
<li class="liMyProject
//anchor tag

</xsl:otherwise>
</xsl:choose>
</xsl:for-each>


</xsl:template>

</xsl:stylesheet>
[/code]
<br/>


View the full article
 
Back
Top