[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Testing if a nodeset is empty
> I would like to avoid an empty <chapter> tag If you use a node set in a boolean context (eg xsl:if test attriubute) then it counts as true if it is non empty and false if it is empty so if you'd been testing against a node set from the source document you would only need to go <xsl:if test="p[@stylename='heading 1,Part']"> but you want to test against a result tree fragment generated by applying templates. rtf can only be compared as strings so: <xsl:variable name="a"><xsl:apply-templates select="p[@stylename='heading 1,Part']" /></xsl:variable> <xsl:if test="$a != ''"> David _____________________________________________________________________ This message has been checked for all known viruses by Star Internet delivered through the MessageLabs Virus Scanning Service. For further information visit http://www.star.net.uk/stats.asp or alternatively call Star Internet for details on the Virus Scanning Service. 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
|