|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Checking the existence of an Element Tag in xml file
> 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 |
\-------------------------------------------------------------------/
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








