[Home] [By Thread] [By Date] [Recent Entries]

  • From: Oliver Becker <obecker@i...>
  • To: clhan@g...
  • Date: Tue, 22 Aug 2000 14:18:30 +0200 (MET DST)

> Does any one out there know how to check whether an  element tag say
> <nameid>  exist in the xml file using xsl  stylesheet?

Just use xsl:if or xsl:choose with an XPath expression to the
element in question.

E.g.
<xsl:template match="/">
   <xsl:choose>
      <xsl:when test="//nameid">Yeah - the document contains a nameid</xsl:when>
      <xsl:otherwise>Sorry, no nameid found</xsl:otherwise>
   </xsl:choose>
</xsl:template>

(Directly typed into my mailer - no warranty for typos)

XSLT questions are better posted to xsl-list,
see http://www.mulberrytech.com/xsl/xsl-list

Cheers,
Oliver


/-------------------------------------------------------------------\
|  ob|do        Dipl.Inf. Oliver Becker                             |
|  --+--        E-Mail: obecker@i...             |
|  op|qo        WWW:    http://www.informatik.hu-berlin.de/~obecker |
\-------------------------------------------------------------------/


Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member