summaryrefslogtreecommitdiffstats
path: root/xml/src/main
diff options
context:
space:
mode:
authorJesse Wilson <jessewilson@google.com>2010-03-17 16:16:15 -0700
committerJesse Wilson <jessewilson@google.com>2010-03-17 16:17:45 -0700
commit03d1c3023ed8ff85ecb0a72d4f5615e6f81e31f6 (patch)
tree6b2f09525b1dc86be48cfd7ac09d8788c4a98e4b /xml/src/main
parent1c5cae46e7b13df73a09504fbe43a78bb6ec41e2 (diff)
downloadlibcore-03d1c3023ed8ff85ecb0a72d4f5615e6f81e31f6.zip
libcore-03d1c3023ed8ff85ecb0a72d4f5615e6f81e31f6.tar.gz
libcore-03d1c3023ed8ff85ecb0a72d4f5615e6f81e31f6.tar.bz2
Fixing 10 of the XPath failures caused by a malformed Document.
See bug 2518858. This makes our XPath implementation fail the exact same tests as the RI's. (which we assume is also based on Apache Xalan) Change-Id: I9a98323113c95609651e948ad11113f84ccd87ec
Diffstat (limited to 'xml/src/main')
-rw-r--r--xml/src/main/java/org/apache/harmony/xml/parsers/DocumentBuilderImpl.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/xml/src/main/java/org/apache/harmony/xml/parsers/DocumentBuilderImpl.java b/xml/src/main/java/org/apache/harmony/xml/parsers/DocumentBuilderImpl.java
index f3956f8..8bce9aa 100644
--- a/xml/src/main/java/org/apache/harmony/xml/parsers/DocumentBuilderImpl.java
+++ b/xml/src/main/java/org/apache/harmony/xml/parsers/DocumentBuilderImpl.java
@@ -257,11 +257,11 @@ class DocumentBuilderImpl extends DocumentBuilder {
}
} else if (token == XmlPullParser.IGNORABLE_WHITESPACE) {
/*
- * Found some ignorable whitespace. We simply take the token
- * text, but we only create a node if the client wants to see
- * whitespace at all.
+ * Found some ignorable whitespace. We only add it if the client
+ * wants to see whitespace. Whitespace before and after the
+ * document element is always ignored.
*/
- if (!ignoreElementContentWhitespace) {
+ if (!ignoreElementContentWhitespace && document != node) {
appendText(document, node, token, parser.getText());
}
} else if (token == XmlPullParser.TEXT || token == XmlPullParser.CDSECT) {