Download presentation
Presentation is loading. Please wait.
1
Lecture 13
2
The various node tests also work on this axis: eg node() This book has descendant-or- self nodes As expected, text nodes are included in the counts this time
3
Xpath axes: the attribute axis This book has attribute nodes As expected, we are told that the books have no attributes Now, the current principal node type is attribute nodes; so the * matches attribute nodes
4
Xpath axes: the attribute axis again This book's title has attribute nodes As expected, we are told that each book title has 1 attribute
5
the attribute axis again: a different XML file This book's title has attribute nodes As expected, we are told that the book titles have differing numbers of attributes
6
abbreviated reference to the attribute axis This book's title has attribute nodes Thus @* is an abbreviation for attribute::*
7
the preceding-sibling axis I found a node. It has preceding-sibling nodes.
8
the preceding-sibling axis and following-sibling axis I found a node. It has preceding-sibling nodes. It has following-sibling nodes. Note that each book now has an author element
9
combining the sibling axes I found a node. It has sibling nodes.
10
the namespace axis As stated earlier, an element has a namespace node –for every attribute on the element whose name starts with xmlns: ; –for every attribute on an ancestor element whose name starts xmlns: unless the element itself or a nearer ancestor redeclares the prefix; –for an xmlns attribute, if the element or some ancestor has an xmlns attribute, and the value of the xmlns attribute for the nearest such element is non-empty In addition, every element in an XML document automatically has a namespace node for the XML namespace
11
the namespace axis (contd.) This book is in the following namespaces:,
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.