示例#1
0
result_t XmlElement::setAttribute(const char *name, const char *value)
{
    obj_ptr<XmlAttr_base> attr = new XmlAttr(m_document, name, value);

    obj_ptr<XmlAttr_base> ret;
    return setAttributeNode(attr, ret);
}
示例#2
0
文件: Element.cpp 项目: 119/vdc
Element::Element(Document* pOwnerDocument, const Element& element): 
	AbstractContainerNode(pOwnerDocument, element),
	_name(pOwnerDocument->namePool().insert(element._name)),
	_pFirstAttr(0)
{
	Attr* pAttr = element._pFirstAttr;
	while (pAttr)
	{
		Attr* pClonedAttr = static_cast<Attr*>(pAttr->copyNode(false, pOwnerDocument));
		setAttributeNode(pClonedAttr);
		pClonedAttr->release();
		pAttr = static_cast<Attr*>(pAttr->_pNext);
	}
}
示例#3
0
文件: Element.cpp 项目: 119/vdc
void Element::setAttribute(const XMLString& name, const XMLString& value)
{
	Attr* pAttr = getAttributeNode(name);
	if (pAttr)
	{
		pAttr->setValue(value);
	}
	else
	{
		pAttr = ownerDocument()->createAttribute(name);
		pAttr->setValue(value);
		setAttributeNode(pAttr);
		pAttr->release();
	}
}