[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: xsk doubt [ ] vs ( )
Hi William, > i have a basic doubt regarding conditions.. > what is the difference between saying > <xsl:if test = "not[. = mytag/mytext]"> This is testing whether the 'not' child element of the current node has a value that is equal to the value of (one of) its child 'mytag' elements's child 'mytext' elements. > and saying > > <xsl:if test = "not(. = mytag/mytext)"> This is testing whether it's not the case that the value of the current node is equal to the value of (one of) its child 'mytag' elements's child 'mytext' elements. > when do we use the [ ] and when do we use ( )?? []s are predicates -- they are used to filter node sets according to some condition. So for example: book[title = 'Genesis'] locates the book element child of the current node whose title element child has the value 'Genesis'. ()s are used to wrap around expressions to indicate priority. So for example: (a and b) or c is different from: a and (b or c) Or, in the case that you've shown above, they're used after the name of a function to hold the arguments for that function. not(), for example, is a function that negates the boolean value of whatever's passed as its argument. ()s are also used as part of node tests, so for example the expression: text() is a shorthand for: child::text() and collects all the text nodes that are children of the current node. Cheers, Jeni --- Jeni Tennison http://www.jenitennison.com/ 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
|