CVS Update: xmlpull-api-v1/src/java/tests/org/xmlpull/v1/tests
Aleksander Andrzej Slominski <[email protected]> Mon, 23 Oct 2006 09:34:48 -0400 (EDT)
| Newsgroups | gmane.text.xml.xmlpull.devel |
|---|---|
| Message-ID | <[email protected]> |
aslom 06/10/23 09:34:48
Modified: addons/java/wrapper/src/org/xmlpull/v1/wrapper
XmlPullParserWrapper.java
src/java/api/org/xmlpull/v1 XmlPullParser.java
src/java/tests/org/xmlpull/v1/tests
TestEntityReplacement.java
Log:
added (commented) proposal for skipSubTree new method in API
added new test to check that calling defineEntityReplacementText works before calling setInput
http://www.extreme.indiana.edu/bugzilla/show_bug.cgi?id=201
Revision Changes Path
1.11 +14 -0 xmlpull-api-v1/addons/java/wrapper/src/org/xmlpull/v1/wrapper/XmlPullParserWrapper.java
Index: XmlPullParserWrapper.java
===================================================================
RCS file: /l/extreme/cvspub/xmlpull-api-v1/addons/java/wrapper/src/org/xmlpull/v1/wrapper/XmlPullParserWrapper.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -t -w -r1.10 -r1.11
--- XmlPullParserWrapper.java 28 Feb 2005 20:18:29 -0000 1.10
+++ XmlPullParserWrapper.java 23 Oct 2006 13:34:48 -0000 1.11
@@ -125,6 +125,20 @@
* Skip sub tree that is currently porser positioned on.
* <br>NOTE: parser must be on START_TAG and when funtion returns
* parser will be positioned on matching END_TAG
+ *
+ * This is typically optimized internally by parser but the logic should follow this:
+ * <code>
+ * pp.require(XmlPullParser.START_TAG, null, null);
+ * int level = 1;
+ * while(level > 0) {
+ * int eventType = pp.next();
+ * if(eventType == XmlPullParser.END_TAG) {
+ * --level;
+ * } else if(eventType == XmlPullParser.START_TAG) {
+ * ++level;
+ * }
+ * }
+ * </code>
*/
public void skipSubTree()
throws XmlPullParserException, IOException;
1.80 +22 -0 xmlpull-api-v1/src/java/api/org/xmlpull/v1/XmlPullParser.java
Index: XmlPullParser.java
===================================================================
RCS file: /l/extreme/cvspub/xmlpull-api-v1/src/java/api/org/xmlpull/v1/XmlPullParser.java,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -b -t -w -r1.79 -r1.80
--- XmlPullParser.java 28 Feb 2005 20:18:29 -0000 1.79
+++ XmlPullParser.java 23 Oct 2006 13:34:48 -0000 1.80
@@ -1112,5 +1112,27 @@
*/
int nextTag() throws XmlPullParserException, IOException;
+
+// /**
+// * Skip sub tree on which the parser is currently positioned on.
+// * <br>NOTE: parser must be on START_TAG and when function returns
+// * parser will be positioned on matching END_TAG
+// *
+// * This method is typically optimized by parser but the its logic should follow this:
+// * <code>
+// * require(XmlPullParser.START_TAG, null, null);
+// * int level = 1;
+// * while(level > 0) {
+// * int eventType = next();
+// * if(eventType == XmlPullParser.END_TAG) {
+// * --level;
+// * } else if(eventType == XmlPullParser.START_TAG) {
+// * ++level;
+// * }
+// * }
+// * </code>
+// */
+// public void skipSubTree() throws XmlPullParserException, IOException;
+
}
1.12 +8 -0 xmlpull-api-v1/src/java/tests/org/xmlpull/v1/tests/TestEntityReplacement.java
Index: TestEntityReplacement.java
===================================================================
RCS file: /l/extreme/cvspub/xmlpull-api-v1/src/java/tests/org/xmlpull/v1/tests/TestEntityReplacement.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -t -w -r1.11 -r1.12
--- TestEntityReplacement.java 28 Feb 2005 20:18:30 -0000 1.11
+++ TestEntityReplacement.java 23 Oct 2006 13:34:48 -0000 1.12
@@ -139,6 +139,14 @@
);
}
+ public void testDefineEntityBeforeSetInput() throws IOException, XmlPullParserException
+ {
+ XmlPullParser pp = factory.newPullParser();
+ pp.defineEntityReplacementText("foo", "bar");
+ pp.setInput(new StringReader( "<foo/>" ) );
+
+ }
+
public static void main (String[] args) {
junit.textui.TestRunner.run (new TestSuite(TestEntityReplacement.class));
}
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/xmlpull-dev/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/xmlpull-dev/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:[email protected]
mailto:[email protected]
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/