|
|
|
@ -33,16 +33,20 @@ class AnalyzeByXPath { |
|
|
|
|
val jxNodes = ArrayList<JXNode>() |
|
|
|
|
val elementsType: String |
|
|
|
|
val rules: Array<String> |
|
|
|
|
if (xPath.contains("&&")) { |
|
|
|
|
when { |
|
|
|
|
xPath.contains("&&") -> { |
|
|
|
|
rules = xPath.split("&&").dropLastWhile { it.isEmpty() }.toTypedArray() |
|
|
|
|
elementsType = "&" |
|
|
|
|
} else if (xPath.contains("%%")) { |
|
|
|
|
} |
|
|
|
|
xPath.contains("%%") -> { |
|
|
|
|
rules = xPath.split("%%").dropLastWhile { it.isEmpty() }.toTypedArray() |
|
|
|
|
elementsType = "%" |
|
|
|
|
} else { |
|
|
|
|
} |
|
|
|
|
else -> { |
|
|
|
|
rules = xPath.split("||").dropLastWhile { it.isEmpty() }.toTypedArray() |
|
|
|
|
elementsType = "|" |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (rules.size == 1) { |
|
|
|
|
return jxDocument!!.selN(rules[0]) |
|
|
|
|
} else { |
|
|
|
@ -79,16 +83,20 @@ class AnalyzeByXPath { |
|
|
|
|
val result = ArrayList<String>() |
|
|
|
|
val elementsType: String |
|
|
|
|
val rules: Array<String> |
|
|
|
|
if (xPath.contains("&&")) { |
|
|
|
|
when { |
|
|
|
|
xPath.contains("&&") -> { |
|
|
|
|
rules = xPath.split("&&").dropLastWhile { it.isEmpty() }.toTypedArray() |
|
|
|
|
elementsType = "&" |
|
|
|
|
} else if (xPath.contains("%%")) { |
|
|
|
|
} |
|
|
|
|
xPath.contains("%%") -> { |
|
|
|
|
rules = xPath.split("%%").dropLastWhile { it.isEmpty() }.toTypedArray() |
|
|
|
|
elementsType = "%" |
|
|
|
|
} else { |
|
|
|
|
} |
|
|
|
|
else -> { |
|
|
|
|
rules = xPath.split("||").dropLastWhile { it.isEmpty() }.toTypedArray() |
|
|
|
|
elementsType = "|" |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (rules.size == 1) { |
|
|
|
|
val jxNodes = jxDocument!!.selN(xPath) |
|
|
|
|
for (jxNode in jxNodes) { |
|
|
|
|