From 55f0d8ebaef56cae86554db984389f55e5e4b729 Mon Sep 17 00:00:00 2001 From: "axel%pike.org" Date: Thu, 9 Jan 2003 14:28:02 +0000 Subject: [PATCH] bug 188339, improve transformiix standalone DOM, get rid of childNodes in Attr, r=peterv, not part of build --- .../source/xml/dom/standalone/Attr.cpp | 45 +++---------------- 1 file changed, 6 insertions(+), 39 deletions(-) diff --git a/extensions/transformiix/source/xml/dom/standalone/Attr.cpp b/extensions/transformiix/source/xml/dom/standalone/Attr.cpp index ca1a50a988d..6e5acbb5de3 100644 --- a/extensions/transformiix/source/xml/dom/standalone/Attr.cpp +++ b/extensions/transformiix/source/xml/dom/standalone/Attr.cpp @@ -87,36 +87,19 @@ Attr::~Attr() } // -//Retrieve the value of the attribute. This is a comma-deliminated string -//representation of the Attribute's children. +//Retrieve the value of the attribute. // const String& Attr::getValue() { - nodeValue = NULL_STRING; - - Node* child = getFirstChild(); - while (child) { - if (child->getNodeType() != Node::ENTITY_REFERENCE_NODE) { - nodeValue.Append(child->getNodeValue()); - child = child->getNextSibling(); - if (child) - nodeValue.Append(PRUnichar(',')); - } else { - child = child->getNextSibling(); - } - } return nodeValue; } // -//Create a new Text node and add it to the Attribute's list of children. Also -//set the Specified flag to true. +//Set the nodevalue to the given value. // void Attr::setValue(const String& newValue) { - NodeDefinition::DeleteChildren(); - - appendChild(getOwnerDocument()->createTextNode(newValue)); + nodeValue = newValue; } @@ -138,31 +121,15 @@ void Attr::setNodeValue(const String& nodeValue) // const String& Attr::getNodeValue() { - return getValue(); + return nodeValue; } // -//First check to see if the new node is an allowable child for an Attr. If it -//is, call NodeDefinition's implementation of AppendChild. If not, return -//null as an error. +//Not implemented anymore, return null as an error. // Node* Attr::appendChild(Node* newChild) { - switch (newChild->getNodeType()) - { - case Node::TEXT_NODE : - { - // Remove the "newChild" if it is already a child of this node - NodeDefinition* pNewChild = (NodeDefinition*)newChild; - if (pNewChild->getParentNode() == this) - pNewChild = implRemoveChild(pNewChild); - - return implAppendChild(pNewChild); - } - default: - break; - } - + NS_ASSERTION(0, "not implemented"); return nsnull; }