зеркало из https://github.com/mozilla/gecko-dev.git
Fixing 53327, patch by jjs@acis.com.au, r=me, string() returns comment nodes, +whitespace, not part of build
This commit is contained in:
Родитель
a14b823f80
Коммит
9e29f9f208
|
@ -21,13 +21,13 @@
|
||||||
* Keith Visco
|
* Keith Visco
|
||||||
* -- original author.
|
* -- original author.
|
||||||
*
|
*
|
||||||
* $Id: XMLDOMUtils.cpp,v 1.6 2000/09/04 16:25:25 axel%pike.org Exp $
|
* $Id: XMLDOMUtils.cpp,v 1.7 2000/10/26 16:45:26 axel%pike.org Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* XMLDOMUtils
|
* XMLDOMUtils
|
||||||
* @author <a href="mailto:kvisco@ziplink.net">Keith Visco</a>
|
* @author <a href="mailto:kvisco@ziplink.net">Keith Visco</a>
|
||||||
* @version $Revision: 1.6 $ $Date: 2000/09/04 16:25:25 $
|
* @version $Revision: 1.7 $ $Date: 2000/10/26 16:45:26 $
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#include "XMLDOMUtils.h"
|
#include "XMLDOMUtils.h"
|
||||||
|
@ -98,7 +98,7 @@ Node* XMLDOMUtils::copyNode(Node* node, Document* owner, NamespaceResolver* reso
|
||||||
for ( i = 0; i < attList->getLength(); i++ ) {
|
for ( i = 0; i < attList->getLength(); i++ ) {
|
||||||
Attr* attr = (Attr*) attList->item(i);
|
Attr* attr = (Attr*) attList->item(i);
|
||||||
#ifdef MOZ_XSL
|
#ifdef MOZ_XSL
|
||||||
resolver->getNameSpaceURI(attr->getName(), nameSpaceURI);
|
resolver->getNameSpaceURI(attr->getName(), nameSpaceURI);
|
||||||
newElement->setAttributeNS(nameSpaceURI, attr->getName(), attr->getValue());
|
newElement->setAttributeNS(nameSpaceURI, attr->getName(), attr->getValue());
|
||||||
#else
|
#else
|
||||||
newElement->setAttribute(attr->getName(), attr->getValue());
|
newElement->setAttribute(attr->getName(), attr->getValue());
|
||||||
|
@ -155,7 +155,12 @@ void XMLDOMUtils::getNodeValue(Node* node, String* target) {
|
||||||
{
|
{
|
||||||
nl = node->getChildNodes();
|
nl = node->getChildNodes();
|
||||||
for ( int i = 0; i < nl->getLength(); i++) {
|
for ( int i = 0; i < nl->getLength(); i++) {
|
||||||
getNodeValue(nl->item(i),target);
|
nodeType = nl->item(i)->getNodeType();
|
||||||
|
if ((nodeType == Node::TEXT_NODE) ||
|
||||||
|
(nodeType == Node::ELEMENT_NODE))
|
||||||
|
{
|
||||||
|
getNodeValue(nl->item(i),target);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче