mirror of
https://github.com/jezhiggins/arabica
synced 2024-11-17 07:48:50 +01:00
factored out attribute node value
This commit is contained in:
parent
d7b9375eba
commit
6dd167b363
1 changed files with 12 additions and 3 deletions
|
@ -92,9 +92,7 @@ class AttrImpl : public DOM::Attr_impl<stringT, string_adaptorT>,
|
|||
{
|
||||
if(!valueCalculated_)
|
||||
{
|
||||
value_ = string_adaptorT::construct_from_utf8("");
|
||||
for(DOMNode_implT* c = NodeT::getFirstChild(); c != 0; c = c->getNextSibling())
|
||||
string_adaptorT::append(value_, c->getNodeValue());
|
||||
value_ = concatNodes(NodeT::getFirstChild());
|
||||
valueCalculated_ = true;
|
||||
}
|
||||
return value_;
|
||||
|
@ -150,6 +148,17 @@ class AttrImpl : public DOM::Attr_impl<stringT, string_adaptorT>,
|
|||
} // cloneChildren
|
||||
|
||||
private:
|
||||
stringT concatNodes(DOMNode_implT* firstChild) const
|
||||
{
|
||||
stringT value;
|
||||
for(DOMNode_implT* c = firstChild; c != 0; c = c->getNextSibling())
|
||||
if(c->getNodeType() == Node_base::ENTITY_REFERENCE_NODE)
|
||||
string_adaptorT::append(value, concatNodes(c->getFirstChild()));
|
||||
else
|
||||
string_adaptorT::append(value, c->getNodeValue());
|
||||
return value;
|
||||
} // concatNodes
|
||||
|
||||
virtual void checkChildType(DOMNode_implT* child)
|
||||
{
|
||||
typename DOM::Node_base::Type type = child->getNodeType();
|
||||
|
|
Loading…
Reference in a new issue