You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by ch...@apache.org on 2005/10/01 12:46:08 UTC
svn commit: r292946 -
/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMStAXWrapper.java
Author: chinthaka
Date: Sat Oct 1 03:45:54 2005
New Revision: 292946
URL: http://svn.apache.org/viewcvs?rev=292946&view=rev
Log:
Fixing Axis2-251
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=292946&r1=292945&r2=292946&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 Sat Oct 1 03:45:54 2005
@@ -17,6 +17,7 @@
package org.apache.axis2.om.impl.llom;
import org.apache.axis2.om.OMAttribute;
+import org.apache.axis2.om.OMComment;
import org.apache.axis2.om.OMElement;
import org.apache.axis2.om.OMNamespace;
import org.apache.axis2.om.OMNode;
@@ -364,8 +365,11 @@
returnString = parser.getText();
} else {
if (hasText()) {
- OMText textNode = (OMText) lastNode;
- returnString = textNode.getText();
+ if (lastNode instanceof OMText) {
+ returnString = ((OMText) lastNode).getText();
+ } else if (lastNode instanceof OMComment){
+ returnString = ((OMComment) lastNode).getValue();
+ }
}
}
return returnString;
@@ -619,7 +623,7 @@
} else {
throw new IllegalStateException(
"attribute count accessed in illegal event (" +
- currentEvent + ")!");
+ currentEvent + ")!");
}
}
return returnCount;
@@ -641,7 +645,7 @@
} else {
if (isStartElement() || (currentEvent == ATTRIBUTE)) {
QName qname = new QName(s, s1);
- OMAttribute attrib = ((OMElement)lastNode).getAttribute(qname);
+ OMAttribute attrib = ((OMElement) lastNode).getAttribute(qname);
if (attrib != null) {
returnString = attrib.getValue();
}
@@ -823,7 +827,7 @@
try {
parser = (XMLStreamReader) builder.getParser();
} catch (Exception e) {
- throw new XMLStreamException("problem accessing the parser",e);
+ throw new XMLStreamException("problem accessing the parser", e);
}
if ((currentEvent == START_DOCUMENT) &&