本文整理汇总了C++中DOMAttr::release方法的典型用法代码示例。如果您正苦于以下问题:C++ DOMAttr::release方法的具体用法?C++ DOMAttr::release怎么用?C++ DOMAttr::release使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DOMAttr
的用法示例。
在下文中一共展示了DOMAttr::release方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: startElement
// ---------------------------------------------------------------------------
// XSDDOMParser: Implementation of the XMLDocumentHandler interface
// ---------------------------------------------------------------------------
void XSDDOMParser::startElement( const XMLElementDecl& elemDecl
, const unsigned int urlId
, const XMLCh* const elemPrefix
, const RefVectorOf<XMLAttr>& attrList
, const unsigned int attrCount
, const bool isEmpty
, const bool isRoot)
{
fDepth++;
// while it is true that non-whitespace character data
// may only occur in appInfo or documentation
// elements, it's certainly legal for comments and PI's to
// occur as children of annotation; we need
// to account for these here.
if (fAnnotationDepth == -1)
{
if (XMLString::equals(elemDecl.getBaseName(), SchemaSymbols::fgELT_ANNOTATION) &&
XMLString::equals(getURIText(urlId), SchemaSymbols::fgURI_SCHEMAFORSCHEMA))
{
fAnnotationDepth = fDepth;
startAnnotation(elemDecl, attrList, attrCount);
}
}
else if (fDepth == fAnnotationDepth+1)
{
fInnerAnnotationDepth = fDepth;
startAnnotationElement(elemDecl, attrList, attrCount);
}
else
{
startAnnotationElement(elemDecl, attrList, attrCount);
// avoid falling through; don't call startElement in this case
return;
}
DOMElement *elem;
if (urlId != fScanner->getEmptyNamespaceId()) //TagName has a prefix
{
if (elemPrefix && *elemPrefix)
{
XMLBufBid elemQName(&fBufMgr);
elemQName.set(elemPrefix);
elemQName.append(chColon);
elemQName.append(elemDecl.getBaseName());
elem = createElementNSNode(
fScanner->getURIText(urlId), elemQName.getRawBuffer());
}
else {
elem = createElementNSNode(
fScanner->getURIText(urlId), elemDecl.getBaseName());
}
}
else {
elem = createElementNSNode(0, elemDecl.getBaseName());
}
DOMElementImpl *elemImpl = (DOMElementImpl *) elem;
for (unsigned int index = 0; index < attrCount; ++index)
{
const XMLAttr* oneAttrib = attrList.elementAt(index);
unsigned int attrURIId = oneAttrib->getURIId();
const XMLCh* namespaceURI = 0;
//for xmlns=...
if (XMLString::equals(oneAttrib->getName(), XMLUni::fgXMLNSString))
attrURIId = fScanner->getXMLNSNamespaceId();
//TagName has a prefix
if (attrURIId != fScanner->getEmptyNamespaceId())
namespaceURI = fScanner->getURIText(attrURIId); //get namespaceURI
// revisit. Optimize to init the named node map to the
// right size up front.
DOMAttrImpl *attr = (DOMAttrImpl *)
fDocument->createAttributeNS(namespaceURI, oneAttrib->getQName());
attr->setValue(oneAttrib -> getValue());
DOMNode* remAttr = elemImpl->setAttributeNodeNS(attr);
if (remAttr)
remAttr->release();
// Attributes of type ID. If this is one, add it to the hashtable of IDs
// that is constructed for use by GetElementByID().
if (oneAttrib->getType()==XMLAttDef::ID)
{
if (fDocument->fNodeIDMap == 0)
fDocument->fNodeIDMap = new (fDocument) DOMNodeIDMap(500, fDocument);
fDocument->fNodeIDMap->add(attr);
attr->fNode.isIdAttr(true);
}
attr->setSpecified(oneAttrib->getSpecified());
}
// set up the default attributes
if (elemDecl.hasAttDefs())
//.........这里部分代码省略.........