本文整理汇总了C++中DOMNamedNodeMap::getNamedItemNS方法的典型用法代码示例。如果您正苦于以下问题:C++ DOMNamedNodeMap::getNamedItemNS方法的具体用法?C++ DOMNamedNodeMap::getNamedItemNS怎么用?C++ DOMNamedNodeMap::getNamedItemNS使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DOMNamedNodeMap
的用法示例。
在下文中一共展示了DOMNamedNodeMap::getNamedItemNS方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: attributeEvent
virtual void attributeEvent(const XMLCh *prefix, const XMLCh *uri, const XMLCh *localname, const XMLCh *value,
const XMLCh *typeURI, const XMLCh *typeName)
{
assert(node_ && node_->getNodeType() == DOMNode::ELEMENT_NODE);
DOMNamedNodeMap *attrs = node_->getAttributes();
DOMAttr *at = (DOMAttr*)attrs->getNamedItemNS(uri, localname);
// Add the attribute
if(!at) {
at = node_->getOwnerDocument()->createAttributeNS(uri, localname);
if(prefix && *prefix)
at->setPrefix(prefix);
attrs->setNamedItemNS(at);
}
// Copy the schema normalized value
at->setNodeValue(value);
// Copy the attribute's type
const XMLCh *oldTypeURI, *oldTypeName;
XercesNodeImpl::typeUriAndName(at, oldTypeURI, oldTypeName);
if(!XPath2Utils::equals(oldTypeName, typeName) ||
!XPath2Utils::equals(oldTypeURI, typeURI)) {
XercesSequenceBuilder::setAttributeTypeInfo(at, typeURI, typeName);
}
}
示例2: setTypes
void XercesUpdateFactory::setTypes(DOMNode *node, const DOMNode *from)
{
if(node->getNodeType() == DOMNode::ELEMENT_NODE) {
const XMLCh *turi, *tname;
XercesNodeImpl::typeUriAndName(from, turi, tname);
XercesSequenceBuilder::setElementTypeInfo((DOMElement *)node, turi, tname);
DOMNamedNodeMap *attrs = node->getAttributes();
DOMNamedNodeMap *attrsfrom = from->getAttributes();
for(unsigned int i = 0; i < attrs->getLength(); ++i) {
DOMNode *a = attrs->item(i);
DOMNode *afrom = attrsfrom->getNamedItemNS(a->getNamespaceURI(), Axis::getLocalName(a));
if(afrom) setTypes(a, afrom);
}
DOMNode *child = node->getFirstChild();
DOMNode *cfrom = from->getFirstChild();
while(child) {
if(child->getNodeType() == DOMNode::ELEMENT_NODE)
setTypes(child, cfrom);
child = child->getNextSibling();
cfrom = cfrom->getNextSibling();
}
}
else if(node->getNodeType() == DOMNode::ATTRIBUTE_NODE) {
const XMLCh *turi, *tname;
XercesNodeImpl::typeUriAndName(from, turi, tname);
XercesSequenceBuilder::setAttributeTypeInfo((DOMAttr *)node, turi, tname);
}
}