CVS Update: xmlpull-api-v1/src/java/api/org/xmlpull/v1
Aleksander Andrzej Slominski <[email protected]> Mon, 19 May 2003 10:40:28 -0500 (EST)
| Newsgroups | gmane.text.xml.xmlpull.devel |
|---|---|
| Message-ID | <[email protected]> |
aslom 03/05/19 10:40:28
Modified: src/java/api/org/xmlpull/v1 XmlPullParser.java
Log:
added to javadoc description how to access currently declared namespace prefixes and URIs (so called namespace context)
Revision Changes Path
1.76 +15 -4 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.75
retrieving revision 1.76
diff -u -b -t -w -r1.75 -r1.76
--- XmlPullParser.java 3 May 2003 06:37:45 -0000 1.75
+++ XmlPullParser.java 19 May 2003 15:40:28 -0000 1.76
@@ -541,10 +541,20 @@
* Returns the numbers of elements in the namespace stack for the given
* depth.
* If namespaces are not enabled, 0 is returned.
-
+ *
* <p><b>NOTE:</b> when parser is on END_TAG then it is allowed to call
* this function with getDepth()+1 argument to retrieve position of namespace
* prefixes and URIs that were declared on corresponding START_TAG.
+ * <p><b>NOTE:</b> to retrieve lsit of namespaces declared in current element:<pre>
+ * XmlPullParser pp = ...
+ * int nsStart = pp.getNamespaceCount(pp.getDepth()-1);
+ * int nsEnd = pp.getNamespaceCount(pp.getDepth());
+ * for (int i = nsStart; i < nsEnd; i++) {
+ * String prefix = pp.getNamespacePrefix(i);
+ * String ns = pp.getNamespaceUri(i);
+ * // ...
+ * }
+ * </pre>
*
* @see #getNamespacePrefix
* @see #getNamespaceUri
@@ -556,6 +566,7 @@
/**
* Returns the namespace prefixe for the given position
* in the namespace stack.
+ * Default namespace declaration (xmlns='...') will have null as prefix.
* If the given index is out of range, an exception is thrown.
* <p><b>Please note:</b> when the parser is on an END_TAG,
* namespace prefixes that were declared
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get A Free Psychic Reading!
Your Online Answer To Life's Important Questions.
http://us.click.yahoo.com/aM1XQD/od7FAA/uetFAA/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/