Returns an XPath node for the element, fetching it from the XPath root node. Returns a new lazy element node if the matching element node is not found.
(self, elem: ElementType)
| 191 | return self._xmlns.get(elem) |
| 192 | |
| 193 | def get_xpath_node(self, elem: ElementType) -> ElementNode: |
| 194 | """ |
| 195 | Returns an XPath node for the element, fetching it from the XPath root node. |
| 196 | Returns a new lazy element node if the matching element node is not found. |
| 197 | """ |
| 198 | xpath_node = self.xpath_root.get_element_node(elem) |
| 199 | if isinstance(xpath_node, ElementNode): |
| 200 | return xpath_node |
| 201 | |
| 202 | try: |
| 203 | return LazyElementNode(elem, nsmap=self._nsmaps[elem]) |
| 204 | except KeyError: |
| 205 | return LazyElementNode(elem) |
| 206 | |
| 207 | def get_absolute_path(self, path: Optional[str] = None) -> str: |
| 208 | if path is None: |
no outgoing calls
no test coverage detected