CVS Update: xmlpull-api-v1/src/java/api/org/xmlpull/v1
Aleksander Andrzej Slominski <[email protected]>
| Newsgroups | gmane.text.xml.xmlpull.devel |
|---|---|
| Message-ID | <[email protected]> |
aslom 02/09/08 14:56:42
Modified: doc changes.html features.html properties.html
src/java/api/org/xmlpull/v1 XmlPullParser.java
Log:
added properties that can be used to report content XMLDecl
and chanaged XmlPullParser javadoc to describe it
Revision Changes Path
1.36 +41 -29 xmlpull-api-v1/doc/changes.html
Index: changes.html
===================================================================
RCS file: /l/extreme/cvspub/xmlpull-api-v1/doc/changes.html,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -b -t -w -r1.35 -r1.36
--- changes.html 2002/08/28 04:54:57 1.35
+++ changes.html 2002/09/08 19:56:42 1.36
@@ -18,7 +18,19 @@
<h3><a name="XMLPULL_1_1_2"></a>2002-09 (XMLPULL_1_1_2)</h3>
<ul>
-<li> </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
+<a href="http://xmlpull.org/v1/doc/properties.html#xmldecl-version">XMLDECL VERSION</a>
+<a href="http://xmlpull.org/v1/doc/features.html#xmldecl-standalone">XMLDECL STANDALONE</a>
+and
+<a href="http://xmlpull.org/v1/doc/features.html#xmldecl-content">XMLDECL CONTENT</a>.
+
+<li>TODO: changed tests to reflect changed handling of XMLDecl
+
+<li>more tests to check for CDATA end-of-line normalization
+
+</ul>
<h3> </h3>
1.17 +8 -4 xmlpull-api-v1/doc/features.html
Index: features.html
===================================================================
RCS file: /l/extreme/cvspub/xmlpull-api-v1/doc/features.html,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -t -w -r1.16 -r1.17
--- features.html 2002/08/27 03:05:58 1.16
+++ features.html 2002/09/08 19:56:42 1.17
@@ -7,12 +7,12 @@
</HEAD>
<BODY BGCOLOR="white">
-<H1>XMLPULL V1 API Features</H2>
+<H1>XmlPull v1 API Features</H2>
<P>
The feature defines a discoverable and possibly changeable characteristic of
-XMLPULL parser.<p>Please note: the key words "<b>MUST</b>", "<b>MUST NOT</b>", "<b>REQUIRED</b>",
+XmlPull parser.<p>Please note: the key words "<b>MUST</b>", "<b>MUST NOT</b>", "<b>REQUIRED</b>",
"<b>SHALL</b>", "<b>SHALL NOT</b>", "<b>SHOULD</b>", "<b>SHOULD NOT</b>", "<b>RECOMMENDED</b>",
"<b>MAY</b>", and "<b>OPTIONAL</b>" in this document are to be interpreted as
described in <a href="http://www.ietf.org/rfc/rfc2119.txt">RFC 2119</a>.</p><h2>
@@ -20,7 +20,8 @@
Standard features</h2>
<P>
-The semantics of of all standard features <b>MUST</b> be followed by every XMLPULL V1 API
+The semantics of of all standard features <b>MUST</b> be followed by every
+XmlPull v1 API
implementation.<P>
All standard feature values <b>MUST NOT</b> change unless setFeature() is called
@@ -99,7 +100,7 @@
<h2>
Optional features</h2>
<p>
-They <b>MAY</b> be supported but are not part of XMLPULL API<p>
+They <b>MAY</b> be supported but are not part of XmlPull API<p>
@@ -171,6 +172,9 @@
<li>for PROCESSING INSTRUCTION event exact content of PI <b>MUST</b> be
returned: in <?target data?> white spaces between target and
data must be preserved</li>
+ <li>content of XMLDecl must be reported as not null by
+ <a href="http://xmlpull.org/v1/doc/features.html#xmldecl-content">XMLDECL
+ CONTENT</a> property</li>
<li>DOCDECL <b>MUST</b> be reported exactly as in input</li>
</ul>
<ul>
1.4 +65 -5 xmlpull-api-v1/doc/properties.html
Index: properties.html
===================================================================
RCS file: /l/extreme/cvspub/xmlpull-api-v1/doc/properties.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -t -w -r1.3 -r1.4
--- properties.html 2002/08/14 19:06:15 1.3
+++ properties.html 2002/09/08 19:56:42 1.4
@@ -7,12 +7,12 @@
</HEAD>
<BODY BGCOLOR="white">
-<H1>XMLPULL V1 API Properties</H2>
+<H1>XmlPull v1 API Properties</H2>
<P>
The property mechanism allows to pass information to
-XMLPULL parser implementation that is not part of API.<p>Please note: the key words "<b>MUST</b>", "<b>MUST NOT</b>", "<b>REQUIRED</b>",
+XmlPull parser implementation that is not part of API.<p>Please note: the key words "<b>MUST</b>", "<b>MUST NOT</b>", "<b>REQUIRED</b>",
"<b>SHALL</b>", "<b>SHALL NOT</b>", "<b>SHOULD</b>", "<b>SHOULD NOT</b>", "<b>RECOMMENDED</b>",
"<b>MAY</b>", and "<b>OPTIONAL</b>" in this document are to be interpreted as
described in <a href="http://www.ietf.org/rfc/rfc2119.txt">RFC 2119</a>.</p><h2>
@@ -20,13 +20,73 @@
Standard properties</h2>
<P>
-Currently there is no standard properties defined.<hr>
+Currently there is no standard properties defined.<P>
+
+ <hr>
<h2>
Optional properties</h2>
<p>
-They <b>MAY</b> be supported but are not part of XMLPULL API<p>
-Please report them to XMLPULL discussion group so they can be added here and
+They <b>MAY</b> be supported but are not part of
+<a href="http://www.xmlpull.org/">XmlPull API</a>.<p>
+Please report them to XmlPull discussion group so they can be added here and
made easier to discover.<p> </p>
+
+<h3>
+<a name="xmldecl-version"></a>Optional property: XMLDECL VERSION</h3>
+<p>This property is identified by
+<a href="http://xmlpull.org/v1/doc/properties.html#xmldecl-version">
+http://xmlpull.org/v1/doc/properties.html#xmldecl-version</a> </p>
+<p>If <a href="http://xmlpull.org/v1/doc/features.html#process-docdecl">PROCESS
+DOCDECL</a> feature is enabled it is REQUIRED property with String otherwise it
+is optional.</p>
+
+<p>If supported and there was
+<a href="http://www.w3.org/TR/REC-xml#NT-VersionInfo">VersionInfo</a> version in
+<a href="http://www.w3.org/TR/REC-xml#NT-XMLDecl">XMLDecl</a> then it returns
+its content if standalone='no' otherwise if there was no standalone declaration
+or this property is not supported it returns null.</p>
+
+<p>For example if input XML stream contained <?xml version='1.0'
+standalone='true'?> then this property will contain "1.0".</p>
+
+<p> </p>
+
+
+<h3>
+<a name="xmldecl-standalone"></a>Optional property: XMLDECL STANDALONE</h3>
+<p>This feature is identified by
+<a href="http://xmlpull.org/v1/doc/features.html#xmldecl-standalone">
+http://xmlpull.org/v1/doc/features.html#xmldecl-standalone</a> </p>
+<p>If <a href="http://xmlpull.org/v1/doc/features.html#process-docdecl">PROCESS
+DOCDECL</a> feature is enabled it is REQUIRED property with Boolean otherwise it
+is optional.</p>
+
+<p>If supported and there was <a href="http://www.w3.org/TR/REC-xml#NT-SDDecl">
+SDDecl</a> standalone in <a href="http://www.w3.org/TR/REC-xml#NT-XMLDecl">
+XMLDecl</a> then it returns Boolean(true) if standalone='yes' or Boolean(false)
+if standalone='no' otherwise if there was no standalone declaration or this
+property is not supported it returns null.</p>
+
+<p> </p>
+
+
+<h3>
+<a name="xmldecl-standalone"></a>Optional property: XMLDECL CONTENT</h3>
+<p>This feature is identified by
+<a href="http://xmlpull.org/v1/doc/features.html#xmldecl-content">
+http://xmlpull.org/v1/doc/features.html#xmldecl-content</a> </p>
+<p>If <a href="http://xmlpull.org/v1/doc/features.html#xml-roundtrip">XML
+ROUNDTRIP</a> feature is enabled it is REQUIRED property with String otherwise
+it is optional.</p>
+
+<p>If XML ROUNDTRIP feature is true then this property MUST contain everything
+after '<?xml' and before final '?>' if XML input contained XMLDecl (see section
+<a href="http://www.w3.org/TR/REC-xml#NT-XMLDecl">2.8 Prolog and Document Type
+Declaration</a> in XML 1.0 ). For example if input XML stream contained <?xml
+version='1.0' standalone='true'?> then this property will contain "
+version='1.0' standalone='true'".</p>
+
+<p> </p>
<h3>
<a name="serializer-indentation"></a>Optional property: SERIALIZER INDENTATION</h3>
1.69 +20 -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.68
retrieving revision 1.69
diff -u -b -t -w -r1.68 -r1.69
--- XmlPullParser.java 2002/08/27 03:22:46 1.68
+++ XmlPullParser.java 2002/09/08 19:56:42 1.69
@@ -51,6 +51,23 @@
* <dt><a href="#END_DOCUMENT">END_DOCUMENT</a><dd> No more events are available
* </dl>
*
+ * <p>after first next() or nextToken() (or any other next*() method)
+ * is called user application can obtain
+ * XML version, standalone and encoding from XML declaration
+ * in following ways:<ul>
+ * <li><b>version</b>:
+ * getProperty("<a href="http://xmlpull.org/v1/doc/properties.html#xmldecl-version">http://xmlpull.org/v1/doc/properties.html#xmldecl-version</a>")
+ * returns String ("1.0") or null if XMLDecl was not read or if property is not supported
+ * <li><b>standalone</b>:
+ * getProperty("<a href="http://xmlpull.org/v1/doc/features.html#xmldecl-standalone">http://xmlpull.org/v1/doc/features.html#xmldecl-standalone")
+ * returns Boolean: null if there was no standalone declaration
+ * or if property is not supported
+ * otherwise returns Boolean(true) if standalon="yes" and Boolean(false) when standalone="no"
+ * <li><b>encoding</b>: obtained from getInputEncoding()
+ * null if stream had unknown encoding (not set in setInputStream)
+ * and it was not declared in XMLDecl
+ * </ul>
+ *
* A minimal example for using this API may look as follows:
* <pre>
* import java.io.IOException;
@@ -966,6 +983,9 @@
*
* <p><strong>NOTE:</strong> whether returned text of token is end-of-line normalized
* is depending on FEATURE_XML_ROUNDTRIP.
+ *
+ * <p><strong>NOTE:</strong> XMLDecl (<?xml ...?>) is not reported but its content
+ * is available through optional properties (see class description above).
*
* @see #next
* @see #START_TAG