[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: question about child::node()
what is the difference between: <xsl:if test="local-name(//preface/child::paramod)"/> and <xsl:if test="local-name(//preface/child::node())='paramod'"> the first one is exactly the same test as <xsl:if test="//preface/paramod"/> and is true if any preface element has a paramod child. (the call to local-name doesn't do anything as it will return 'paramod' if there is an element and '' otherwise but in a boolean test non empty strings and non empty node sets are both counted teh same as true) the second one is true if the first node in the document that is a child of a preface element has local name 'paramod' and is false otherwise. It would for example be false for <preface> <paramod> as the first child node or preface is a text node with a newline and a space. Both of these expressions are highly strange they use // to search the entire document and then throw away almost all of the information and just test one node. What are you actually trying to test? David ________________________________________________________________________ This e-mail has been scanned for all viruses by Star Internet. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________ 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
|