mirror of
https://github.com/github/codeql.git
synced 2026-05-01 11:45:14 +02:00
python: model XPathEvaluator
This commit is contained in:
@@ -70,4 +70,19 @@ private module Lxml {
|
||||
|
||||
override string getName() { result = "lxml.etree" }
|
||||
}
|
||||
|
||||
class XPathEvaluatorCall extends XPathExecution::Range, DataFlow::CallCfgNode {
|
||||
XPathEvaluatorCall() {
|
||||
this =
|
||||
API::moduleImport("lxml")
|
||||
.getMember("etree")
|
||||
.getMember("XPathEvaluator")
|
||||
.getReturn()
|
||||
.getACall()
|
||||
}
|
||||
|
||||
override DataFlow::Node getXPath() { result = this.getArg(0) }
|
||||
|
||||
override string getName() { result = "lxml.etree" }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,4 +18,4 @@ def test_ETXpath_class():
|
||||
def test_XPathEvaluator_class():
|
||||
root = etree.XML("<root><a>TEXT</a></root>")
|
||||
search_root = etree.XPathEvaluator(root)
|
||||
text = search_root("path")[0] # $ MISSING: getXPath="path"
|
||||
text = search_root("path")[0] # $ getXPath="path"
|
||||
|
||||
Reference in New Issue
Block a user