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