本文整理汇总了C++中DOMDocumentImpl::getNodeIDMap方法的典型用法代码示例。如果您正苦于以下问题:C++ DOMDocumentImpl::getNodeIDMap方法的具体用法?C++ DOMDocumentImpl::getNodeIDMap怎么用?C++ DOMDocumentImpl::getNodeIDMap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DOMDocumentImpl
的用法示例。
在下文中一共展示了DOMDocumentImpl::getNodeIDMap方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setValue
void DOMAttrImpl::setValue(const XMLCh *val)
{
if (fNode.isReadOnly())
{
throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR, 0, GetDOMNodeMemoryManager);
}
// If this attribute was of type ID and in the map, take it out,
// then put it back in with the new name. For now, we don't worry
// about what happens if the new name conflicts
//
DOMDocumentImpl *doc = (DOMDocumentImpl *)getOwnerDocument();
if (fNode.isIdAttr())
doc->getNodeIDMap()->remove(this);
DOMNode *kid;
while ((kid = fParent.fFirstChild) != 0) // Remove existing kids
{
DOMNode* node = removeChild(kid);
if (node)
node->release();
}
if (val != 0) // Create and add the new one
appendChild(doc->createTextNode(val));
fNode.isSpecified(true);
fParent.changed();
if (fNode.isIdAttr())
doc->getNodeIDMap()->add(this);
}
示例2: DOMAttr
DOMAttrImpl::DOMAttrImpl(const DOMAttrImpl &other, bool /*deep*/)
: DOMAttr(other)
, fNode(other.fNode)
, fParent (other.fParent)
, fName(other.fName)
, fSchemaType(other.fSchemaType)
{
if (other.fNode.isSpecified())
fNode.isSpecified(true);
else
fNode.isSpecified(false);
if (other.fNode.isIdAttr())
{
fNode.isIdAttr(true);
DOMDocumentImpl *doc = (DOMDocumentImpl *)this->getOwnerDocument();
doc->getNodeIDMap()->add(this);
}
fParent.cloneChildren(&other);
}