p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   XSLT (http://p2p.wrox.com/forumdisplay.php?f=86)
-   -   How to check for the presence of an attribute (http://p2p.wrox.com/showthread.php?t=45756)

dsekar_nat July 27th, 2006 12:33 AM

How to check for the presence of an attribute
 
Hi All,

Is there is a way to check the presence of an attribute or not in a tag using XSLT.

regards,
dsekar_nat


mhkay July 27th, 2006 03:36 AM


Tags don't exist in XSLT - you mean "element node".

If the element node in question is the context node, use

<xsl:if test="@a">

to test whether it has an attribute named a.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference

dsekar_nat July 27th, 2006 05:04 AM

Thank you Kay



All times are GMT -4. The time now is 08:50 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.