xpath - XSLT 1.0: how to go for the "parent" axis -
xpath - XSLT 1.0: how to go for the "parent" axis -
i have question concerning performance of xslt calling "parent" axis in xpath. can phone call parent axis using "::*" or phone call using "::" , name of element
parent::*/mvke/item/vmsta='z2'
or
parent::item/mvke/item/vmsta='z2'
does matter performance wise if utilize "*" or if utilize name of node element? both work wondering difference is. can please explain me?
thank much help , best regards, peter
the first look matches any element parent. sec look matches when parent item
element. that's difference. can't imagine important performance impact, since both node tests can performed in constant time.
note line xpath 1.0 spec:
every node other root node has 1 parent, either element node or root node.
in practice means parent::*
matches any parent except of root element.
to demonstrate, consider simple illustration document:
<root> <one/> <item> <two/> </item> </root>
then:
//parent::*
root
, item
elements (every parent node element)
//parent::item
homecoming item
element (the parent element item
)
//parent::node()
parent of root
(i.e. root node) root
, item
elements
xslt xpath parent
Comments
Post a Comment