[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: check if a node is empty
Hi Jeremy, the test for empty node elements would be: <xsl:when test="node[not(*)]"> ... whatever happens when node is empty </xsl:when> Some more examples: .. test="node[not(a)]" will be true only if node does not contains an <a> node .. test="node[a]" will be true only if node contains an <a> node Hope that helps. cheers Malcolm -----Original Message----- From: jeremyf@xxxxxxxxxxx [mailto:jeremyf@xxxxxxxxxxx] Sent: Thursday, October 17, 2002 9:17 AM To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx Subject: check if a node is empty Hi all, I have done some preliminary research, but perhaps I am making this harder than it is (or perhaps I have not asked the right questions of the knowledge base) Here is my problem: I have an XML document that may contain nodes with no children <node> </node> I need to test if this is the case in my XSL in order to output the correct information <xsl:choose> <xsl:when test .... > do some process here </xsl:when> <xsl:otherwise> no process to do </xsl:otherwise> </xsl:choose> I am sure it is simple so if someone could point me in the right direction or give a bit of a clue I am very appreciative. Thanks in advance Jeremy XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list 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
|