Author: amassari
Date: Tue Oct 25 07:46:07 2005
New Revision: 328373

URL: http://svn.apache.org/viewcvs?rev=328373&view=rev
Log:
Nodes that implement getFeature should also implement isSupported (jira# 1479)

Modified:
    xerces/c/trunk/src/xercesc/dom/impl/DOMAttrImpl.cpp
    xerces/c/trunk/src/xercesc/dom/impl/DOMDocumentTypeImpl.cpp
    xerces/c/trunk/src/xercesc/dom/impl/DOMElementNSImpl.cpp
    xerces/c/trunk/src/xercesc/dom/impl/DOMElementNSImpl.hpp

Modified: xerces/c/trunk/src/xercesc/dom/impl/DOMAttrImpl.cpp
URL: 
http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/dom/impl/DOMAttrImpl.cpp?rev=328373&r1=328372&r2=328373&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/impl/DOMAttrImpl.cpp (original)
+++ xerces/c/trunk/src/xercesc/dom/impl/DOMAttrImpl.cpp Tue Oct 25 07:46:07 2005
@@ -300,6 +300,13 @@
     fSchemaType = typeInfo;
 }
 
+bool DOMAttrImpl::isSupported(const XMLCh *feature, const XMLCh *version) const
+{
+    // check for '+DOMPSVITypeInfo'
+    if(feature && *feature=='+' && XMLString::equals(feature+1, 
XMLUni::fgXercescInterfacePSVITypeInfo))
+        return true;
+    return fNode.isSupported (feature, version);
+}
 
 void* DOMAttrImpl::getFeature(const XMLCh* feature, const XMLCh* version)
 {
@@ -327,8 +334,6 @@
            DOMNode*         DOMAttrImpl::removeChild(DOMNode *oldChild)        
  {return fParent.removeChild (oldChild); }
            DOMNode*         DOMAttrImpl::replaceChild(DOMNode *newChild, 
DOMNode *oldChild)
                                                                                
  {return fParent.replaceChild (newChild, oldChild); }
-           bool             DOMAttrImpl::isSupported(const XMLCh *feature, 
const XMLCh *version) const
-                                                                               
  {return fNode.isSupported (feature, version); }
            void             DOMAttrImpl::setPrefix(const XMLCh  *prefix)       
  {fNode.setPrefix(prefix); }
            bool             DOMAttrImpl::hasAttributes() const                 
  {return fNode.hasAttributes(); }
            bool             DOMAttrImpl::isSameNode(const DOMNode* other) 
const  {return fNode.isSameNode(other); }

Modified: xerces/c/trunk/src/xercesc/dom/impl/DOMDocumentTypeImpl.cpp
URL: 
http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/dom/impl/DOMDocumentTypeImpl.cpp?rev=328373&r1=328372&r2=328373&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/impl/DOMDocumentTypeImpl.cpp (original)
+++ xerces/c/trunk/src/xercesc/dom/impl/DOMDocumentTypeImpl.cpp Tue Oct 25 
07:46:07 2005
@@ -424,8 +424,6 @@
            DOMNode*         DOMDocumentTypeImpl::removeChild(DOMNode 
*oldChild)          {return fParent.removeChild (oldChild); }
            DOMNode*         DOMDocumentTypeImpl::replaceChild(DOMNode 
*newChild, DOMNode *oldChild)
                                                                                
          {return fParent.replaceChild (newChild, oldChild); }
-           bool             DOMDocumentTypeImpl::isSupported(const XMLCh 
*feature, const XMLCh *version) const
-                                                                               
          {return fNode.isSupported (feature, version); }
            void             DOMDocumentTypeImpl::setPrefix(const XMLCh  
*prefix)         {fNode.setPrefix(prefix); }
            bool             DOMDocumentTypeImpl::hasAttributes() const         
          {return fNode.hasAttributes(); }
            bool             DOMDocumentTypeImpl::isSameNode(const DOMNode* 
other) const  {return fNode.isSameNode(other); }
@@ -531,6 +529,14 @@
     }
 
     return fParent.isEqualNode(arg);
+}
+
+bool DOMDocumentTypeImpl::isSupported(const XMLCh *feature, const XMLCh 
*version) const
+{
+    // check for 'DOMDocumentTypeImpl'
+    if(XMLString::equals(feature, 
XMLUni::fgXercescInterfaceDOMDocumentTypeImpl))
+        return true;
+    return fNode.isSupported (feature, version);
 }
 
 void* DOMDocumentTypeImpl::getFeature(const XMLCh* feature, const XMLCh* 
version)

Modified: xerces/c/trunk/src/xercesc/dom/impl/DOMElementNSImpl.cpp
URL: 
http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/dom/impl/DOMElementNSImpl.cpp?rev=328373&r1=328372&r2=328373&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/impl/DOMElementNSImpl.cpp (original)
+++ xerces/c/trunk/src/xercesc/dom/impl/DOMElementNSImpl.cpp Tue Oct 25 
07:46:07 2005
@@ -258,6 +258,14 @@
     fSchemaType = typeInfo;
 }
 
+bool DOMElementNSImpl::isSupported(const XMLCh *feature, const XMLCh *version) 
const
+{
+    // check for '+DOMPSVITypeInfo'
+    if(feature && *feature=='+' && XMLString::equals(feature+1, 
XMLUni::fgXercescInterfacePSVITypeInfo))
+        return true;
+    return fNode.isSupported (feature, version);
+}
+
 void* DOMElementNSImpl::getFeature(const XMLCh* feature, const XMLCh* version)
 {
     if(XMLString::equals(feature, XMLUni::fgXercescInterfacePSVITypeInfo))

Modified: xerces/c/trunk/src/xercesc/dom/impl/DOMElementNSImpl.hpp
URL: 
http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/dom/impl/DOMElementNSImpl.hpp?rev=328373&r1=328372&r2=328373&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/impl/DOMElementNSImpl.hpp (original)
+++ xerces/c/trunk/src/xercesc/dom/impl/DOMElementNSImpl.hpp Tue Oct 25 
07:46:07 2005
@@ -54,6 +54,7 @@
     DOMElementNSImpl(const DOMElementNSImpl &other, bool deep=false);
 
     virtual DOMNode * cloneNode(bool deep) const;
+    virtual bool isSupported(const XMLCh *feature, const XMLCh *version) const;
     virtual void* getFeature(const XMLCh* feature, const XMLCh* version);
 
     //Introduced in DOM Level 2



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to