[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] matching when the attribute or element is NOT there
So this works for detecting when elements or attributes exist... <xsl:template match="/main/child[subchild]"> <xsl:text>Child contains a subchild element.</xsl:text> </xsl:template> <xsl:template match="/main/child[@attr]"> <xsl:text>Child contains the attr attribute.</xsl:text> </xsl:template> This does not work... is there another way to do this in the match statement? I know I can write this with an if statement, but I'm trying to do some grouping work that requires the check occur in the match statement. <xsl:template match="/main/child[not(subchild)]"> <xsl:text>Child does not contain a subchild element.</xsl:text> </xsl:template> <xsl:template match="/main/child[not(@attr)]"> <xsl:text>Child does not contain the attr attribute.</xsl:text> </xsl:template> Any help? Thanks, Carl XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|