axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r356660 - /webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMStAXWrapper.java
Date Wed, 14 Dec 2005 00:57:31 GMT
Author: dims
Date: Tue Dec 13 16:57:27 2005
New Revision: 356660

URL: http://svn.apache.org/viewcvs?rev=356660&view=rev
Log:
implement nextTag - thanks to Guillaume Nodet

Modified:
    webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMStAXWrapper.java

Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMStAXWrapper.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMStAXWrapper.java?rev=356660&r1=356659&r2=356660&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMStAXWrapper.java
(original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMStAXWrapper.java
Tue Dec 13 16:57:27 2005
@@ -782,7 +782,7 @@
     }
 
     /**
-     * Not implemented yet
+     * nextTag - returns the next tag
      *
      * @return
      * @throws org.apache.axis2.om.impl.llom.exception.OMStreamingException
@@ -790,9 +790,20 @@
      * @throws XMLStreamException
      */
     public int nextTag() throws XMLStreamException {
-        throw new UnsupportedOperationException();
+        int eventType = next();
+        while((eventType == XMLStreamConstants.CHARACTERS && isWhiteSpace()) // skip
whitespace
+            || (eventType == XMLStreamConstants.CDATA && isWhiteSpace()) // skip
whitespace
+            || eventType == XMLStreamConstants.SPACE
+            || eventType == XMLStreamConstants.PROCESSING_INSTRUCTION
+            || eventType == XMLStreamConstants.COMMENT) {
+            eventType = next();
+         }
+         if (eventType != XMLStreamConstants.START_ELEMENT && eventType != XMLStreamConstants.END_ELEMENT)
{
+             throw new XMLStreamException("expected start or end tag", getLocation());
+         }
+         return eventType;    
     }
-
+    
     /**
      * @return
      * @throws XMLStreamException



Mime
View raw message