summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorChris Burdess <dog@bluezoo.org>2005-12-14 19:42:12 +0000
committerChris Burdess <dog@bluezoo.org>2005-12-14 19:42:12 +0000
commite5c817a4efbf34f20c6b017369c0b6d8ef42e5ae (patch)
tree8505509625f265a64c0156e843649049708a460e /gnu
parent69c2d6f3f89de667ce1dde82cba5efe78a36f88c (diff)
downloadclasspath-e5c817a4efbf34f20c6b017369c0b6d8ef42e5ae.tar.gz
2005-12-14 Chris Burdess <dog@gnu.org>
* gnu/xml/stream/XIncludeFilter.java: Fix event flow on fallback. * gnu/xml/stream/XMLParser.java: Don't pop namespace context until after END_ELEMENT has been read; fix CDATA section detection.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/xml/stream/XIncludeFilter.java8
-rw-r--r--gnu/xml/stream/XMLParser.java21
2 files changed, 14 insertions, 15 deletions
diff --git a/gnu/xml/stream/XIncludeFilter.java b/gnu/xml/stream/XIncludeFilter.java
index 576af90c5..a9a831df6 100644
--- a/gnu/xml/stream/XIncludeFilter.java
+++ b/gnu/xml/stream/XIncludeFilter.java
@@ -607,13 +607,9 @@ class XIncludeFilter
depth--;
}
}
- // Return next event
- return next();
}
else
- {
- inInclude = true;
- }
+ inInclude = true;
}
else if (inInclude && "fallback".equals(localName))
{
@@ -627,6 +623,7 @@ class XIncludeFilter
throw new XMLStreamException("illegal xi element '" +
localName + "'");
}
+ return next();
}
break;
case XMLStreamConstants.END_ELEMENT:
@@ -648,6 +645,7 @@ class XIncludeFilter
}
else if ("fallback".equals(localName))
inFallback = false;
+ return next();
}
break;
}
diff --git a/gnu/xml/stream/XMLParser.java b/gnu/xml/stream/XMLParser.java
index ba3d64b88..f4292549b 100644
--- a/gnu/xml/stream/XMLParser.java
+++ b/gnu/xml/stream/XMLParser.java
@@ -745,6 +745,12 @@ public class XMLParser
lookahead = false;
return event;
}
+ if (event == XMLStreamConstants.END_ELEMENT)
+ {
+ // Pop namespace context
+ if (namespaceAware)
+ namespaces.removeFirst();
+ }
try
{
switch (state)
@@ -767,6 +773,11 @@ public class XMLParser
readPI();
event = XMLStreamConstants.PROCESSING_INSTRUCTION;
}
+ else if (tryRead(TEST_CDATA))
+ {
+ readCDSect();
+ event = XMLStreamConstants.CDATA;
+ }
else if (tryRead(TEST_START_ELEMENT))
{
state = readStartElement();
@@ -777,19 +788,12 @@ public class XMLParser
readReference();
event = XMLStreamConstants.ENTITY_REFERENCE;
}
- else if (tryRead(TEST_CDATA))
- {
- readCDSect();
- event = XMLStreamConstants.CDATA;
- }
else
event = readCharData();
break;
case EMPTY_ELEMENT:
state = stack.isEmpty() ? MISC : CONTENT;
event = XMLStreamConstants.END_ELEMENT;
- // Pop namespace context
- namespaces.removeFirst();
break;
case INIT: // XMLDecl?
input.init();
@@ -1969,9 +1973,6 @@ public class XMLParser
require(expected);
skipWhitespace();
require('>');
- // Pop namespace context
- if (namespaceAware)
- namespaces.removeFirst();
// Make element name available
buf.setLength(0);
buf.append(expected);