Skip to content

Commit 5501875

Browse files
committed
2 parents 01cbec6 + 06f8184 commit 5501875

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/main/java/javafxlibrary/utils/finder/XPathFinder.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import javafx.scene.Parent;
55
import javafxlibrary.exceptions.JavaFXLibraryNonFatalException;
66
import javafxlibrary.utils.RobotLog;
7+
import org.apache.commons.lang.StringUtils;
78
import org.w3c.dom.Document;
89
import org.w3c.dom.NamedNodeMap;
910
import org.w3c.dom.NodeList;
@@ -20,6 +21,8 @@
2021
import java.util.List;
2122
import java.util.Set;
2223

24+
import static org.apache.commons.lang3.StringUtils.countMatches;
25+
2326
public class XPathFinder {
2427

2528
private StringBuilder sb;
@@ -170,6 +173,11 @@ private void parseAttributes(Node node) {
170173
attributeBuilder.append(att.replace("=", "=\""));
171174
attributeBuilder.append("\"");
172175
} else {
176+
if(countMatches(att, "\"") > 2) {
177+
att = att.replaceAll("\"", """);
178+
att = att.replaceFirst(""", "\"");
179+
att = att.replaceAll(""$", "\"");
180+
}
173181
attributeBuilder.append(att);
174182
}
175183
} else {

0 commit comments

Comments
 (0)