From a34406a60003ecd1e457402dae639d78dbcd4477 Mon Sep 17 00:00:00 2001 From: xiaohuo Date: Thu, 14 Feb 2019 16:29:35 +0800 Subject: [PATCH] v2.3.0 --- .../java/org/seimicrawler/xpath/core/XpathProcessor.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/seimicrawler/xpath/core/XpathProcessor.java b/src/main/java/org/seimicrawler/xpath/core/XpathProcessor.java index c5e80e4..74661f8 100644 --- a/src/main/java/org/seimicrawler/xpath/core/XpathProcessor.java +++ b/src/main/java/org/seimicrawler/xpath/core/XpathProcessor.java @@ -474,7 +474,14 @@ public XValue visitUnionExprNoRoot(XpathParser.UnionExprNoRootContext ctx) { throw new XpathMergeValueException("can not merge val1="+pathExprNoRoot.asDouble()+",val2="+unionExprNoRoot.asString()); } }else { - return XValue.create(pathExprNoRoot.asString()+","+unionExprNoRoot.asString()); + List tmpVal = new LinkedList<>(); + if (StringUtils.isNotBlank(pathExprNoRoot.asString())){ + tmpVal.add(pathExprNoRoot.asString()); + } + if (StringUtils.isNotBlank(unionExprNoRoot.asString())){ + tmpVal.add(unionExprNoRoot.asString()); + } + return XValue.create(StringUtils.join(tmpVal,",")); } }