CVS Update: xmlpull-api-v1/src/java/tests/org/xmlpull/v1/tests
Aleksander Andrzej Slominski <[email protected]> Tue, 25 Feb 2003 23:13:06 -0500 (EST)
| Newsgroups | gmane.text.xml.xmlpull.devel |
|---|---|
| Message-ID | <[email protected]> |
aslom 03/02/25 23:13:06
Modified: doc changes.html
src/java/samples MyXmlPullApp.java
src/java/tests/org/xmlpull/v1/tests TestSerializeWithNs.java
Log:
added test to check that generating namespae prefix for attributes is allowed
(method getPrefix(uri, true) called after startTag() shoul dadd new prefix to
current start tag elements and not next start tag)
Revision Changes Path
1.43 +16 -4 xmlpull-api-v1/doc/changes.html
Index: changes.html
===================================================================
RCS file: /l/extreme/cvspub/xmlpull-api-v1/doc/changes.html,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -b -t -w -r1.42 -r1.43
--- changes.html 17 Feb 2003 22:09:08 -0000 1.42
+++ changes.html 26 Feb 2003 04:13:05 -0000 1.43
@@ -7,21 +7,33 @@
</HEAD>
<BODY BGCOLOR="white">
-<H1>Changes to XmlPull V1 API</H1><P>
+<H1>Changes to XmlPull v1 API</H1><P>
-<h3>IN PROGRESS: <a name="XMLPULL_1_2_1"></a>2002-11-... (XMLPULL_1_2_1)</h3>
+<h3>IN PROGRESS: <a name="XMLPULL_1_2_1"></a>2003-03-... (XMLPULL_1_2_1)</h3>
<ul>
<li>this will be next official stable release (based on last of 1.1.x) to
incorporate all changes since 1.0.x in stable version </ul>
<h3>IN PROGRESS INTERIM RELEASE: </h3>
-<h3><a name="XMLPULL_1_1_2"></a>2002-10-16 (XMLPULL_1_1_2)</h3>
+<h3><a name="XMLPULL_1_1_3"></a>2003-03 (XMLPULL_1_1_3)</h3>
+
+<ul>
+<li>added test to check that generating namespae prefix for attributes is allowed
+(method getPrefix(uri, true) called after startTag() shoul dadd new prefix to
+current start tag elements and not next start tag)
+
+<li>added tests to check optional support for formatting XML output from XML serializer
+
<li>added to addons SAX2 driver,
removed AttributesCachingDriver but left documented how to achieve this functionality
<li>added to addons XML RPC implementation
-<ul>
+</ul>
+
+<h3><a name="XMLPULL_1_1_2"></a>2002-10-16 (XMLPULL_1_1_2)</h3>
+
+<ul>
<li><b>NOTE:</b> <b>potentially backward incompatible change to nextToken</b>():
XMLDecl (<?xml ... ?>) will no longer be reported as PROCESSING_INSTRUCTION
but instead content of XMLDecl is made available as set of properties
1.10 +0 -3 xmlpull-api-v1/src/java/samples/MyXmlPullApp.java
Index: MyXmlPullApp.java
===================================================================
RCS file: /l/extreme/cvspub/xmlpull-api-v1/src/java/samples/MyXmlPullApp.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -t -w -r1.9 -r1.10
--- MyXmlPullApp.java 18 Feb 2003 19:48:11 -0000 1.9
+++ MyXmlPullApp.java 26 Feb 2003 04:13:06 -0000 1.10
@@ -4,9 +4,6 @@
import java.io.FileReader;
import java.io.IOException;
import java.io.StringReader;
-
-
-
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import org.xmlpull.v1.XmlPullParserFactory;
1.14 +20 -4 xmlpull-api-v1/src/java/tests/org/xmlpull/v1/tests/TestSerializeWithNs.java
Index: TestSerializeWithNs.java
===================================================================
RCS file: /l/extreme/cvspub/xmlpull-api-v1/src/java/tests/org/xmlpull/v1/tests/TestSerializeWithNs.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -t -w -r1.13 -r1.14
--- TestSerializeWithNs.java 25 Feb 2003 20:08:12 -0000 1.13
+++ TestSerializeWithNs.java 26 Feb 2003 04:13:06 -0000 1.14
@@ -139,9 +139,9 @@
}
- //TODO add test for simple namespace generation
public void testNamespaceGeneration() throws Exception {
XmlSerializer ser = factory.newSerializer();
+ System.out.println(getClass()+" ser="+ser);
StringWriter sw = new StringWriter();
ser.setOutput(sw);
@@ -150,18 +150,34 @@
ser.startDocument("ISO-8859-1", Boolean.TRUE);
- ser.setPrefix("soap", "http://tm");
+ ser.setPrefix("boo", "http://example.com/boo");
ser.startTag("", "foo");
+ ser.attribute("http://example.com/boo", "attr", "val");
- //TODO: check that startTag(null, ...) is not allowed
+ String booPrefix = ser.getPrefix("http://example.com/boo", false);
+ assertEquals("boo", booPrefix);
+
+ //check that new prefix may be generated after startTag and used as attribbute value
+ String newPrefix = ser.getPrefix("http://example.com/bar", true);
+ ser.attribute("http://example.com/bar", "attr", "val");
+
+ ser.startTag("http://example.com/bar", "foo");
+ ser.endTag("http://example.com/bar", "foo");
+
+ String checkPrefix = ser.getPrefix("http://example.com/bar", false);
+ assertEquals(newPrefix, checkPrefix);
ser.endTag("", "foo");
+ checkPrefix = ser.getPrefix("http://example.com/bar", false);
+ assertEquals(null, checkPrefix);
+
ser.endDocument();
//xpp.setInput(new StringReader("<foo></foo>"));
String serialized = sw.toString();
- xpp.setInput(new StringReader(serialized));
+ System.out.println(getClass()+" serialized="+serialized);
+ //xpp.setInput(new StringReader(serialized));
}
public void testMisc() throws Exception {
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get 128 Bit SSL Encryption!
http://us.click.yahoo.com/FpY02D/vN2EAA/xGHJAA/2U_rlB/TM
---------------------------------------------------------------------~->
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/