You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by am...@apache.org on 2007/01/02 16:11:29 UTC
svn commit: r491809 - /xerces/c/trunk/src/xercesc/dom/impl/DOMElementImpl.cpp
Author: amassari
Date: Tue Jan 2 07:11:29 2007
New Revision: 491809
URL: http://svn.apache.org/viewvc?view=rev&rev=491809
Log:
When calling getAttributeNodeNS, ensure we are providing a localName (XERCESC-1473)
Modified:
xerces/c/trunk/src/xercesc/dom/impl/DOMElementImpl.cpp
Modified: xerces/c/trunk/src/xercesc/dom/impl/DOMElementImpl.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/dom/impl/DOMElementImpl.cpp?view=diff&rev=491809&r1=491808&r2=491809
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/impl/DOMElementImpl.cpp (original)
+++ xerces/c/trunk/src/xercesc/dom/impl/DOMElementImpl.cpp Tue Jan 2 07:11:29 2007
@@ -332,11 +332,13 @@
const XMLCh *qualifiedName, const XMLCh *fValue)
{
if (fNode.isReadOnly())
- throw DOMException(
- DOMException::NO_MODIFICATION_ALLOWED_ERR, 0, GetDOMNodeMemoryManager);
+ throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR, 0, GetDOMNodeMemoryManager);
- DOMAttr* newAttr = getAttributeNodeNS(fNamespaceURI, qualifiedName);
+ int index = DOMDocumentImpl::indexofQualifiedName(qualifiedName);
+ if (index < 0)
+ throw DOMException(DOMException::NAMESPACE_ERR, 0, GetDOMNodeMemoryManager);
+ DOMAttr* newAttr = getAttributeNodeNS(fNamespaceURI, qualifiedName+index);
if (!newAttr)
{
newAttr = this->fNode.getOwnerDocument()->createAttributeNS(fNamespaceURI, qualifiedName);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org