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 di...@apache.org on 2005/07/11 02:00:14 UTC
svn commit: r210058 - in
/webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/om:
impl/llom/OMTextImpl.java xpath/DocumentNavigator.java
Author: dims
Date: Sun Jul 10 17:00:13 2005
New Revision: 210058
URL: http://svn.apache.org/viewcvs?rev=210058&view=rev
Log:
fix getType in OMTextImpl, fix identifying of comments and pi in document navigator
Modified:
webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMTextImpl.java
webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/om/xpath/DocumentNavigator.java
Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMTextImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMTextImpl.java?rev=210058&r1=210057&r2=210058&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMTextImpl.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMTextImpl.java Sun Jul 10 17:00:13 2005
@@ -183,18 +183,22 @@
*/
public void setTextType(short type) {
if ((type == TEXT_NODE) || (type == COMMENT_NODE)
- || (type == CDATA_SECTION_NODE)) {
+ || (type == CDATA_SECTION_NODE
+ || (type == PI_NODE))) {
this.textType = type;
} else {
throw new UnsupportedOperationException("Attempt to set wrong type");
}
}
- public int getType() throws OMException {
- return textType;
- }
+ public int getType() throws OMException {
+ int type = super.getType();
+ if (type == COMMENT_NODE || type == CDATA_SECTION_NODE || type == PI_NODE)
+ return type;
+ return textType;
+ }
- /**
+ /**
* @param writer
* @throws XMLStreamException
*/
Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/om/xpath/DocumentNavigator.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/om/xpath/DocumentNavigator.java?rev=210058&r1=210057&r2=210058&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/om/xpath/DocumentNavigator.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/om/xpath/DocumentNavigator.java Sun Jul 10 17:00:13 2005
@@ -173,7 +173,7 @@
*/
public boolean isComment(Object object) {
return (object instanceof OMNode) &&
- (((OMText) object).getType() == OMNode.COMMENT_NODE);
+ (((OMNode) object).getType() == OMNode.COMMENT_NODE);
}
/**
@@ -196,8 +196,8 @@
* else <code>false</code>
*/
public boolean isProcessingInstruction(Object object) {
- //TODO: Fix this?
- return false;
+ return (object instanceof OMNode) &&
+ (((OMNode) object).getType() == OMNode.PI_NODE);
}
/**