当前位置: 首页>>代码示例>>C++>>正文


C++ DOMNode::getLocalName方法代码示例

本文整理汇总了C++中DOMNode::getLocalName方法的典型用法代码示例。如果您正苦于以下问题:C++ DOMNode::getLocalName方法的具体用法?C++ DOMNode::getLocalName怎么用?C++ DOMNode::getLocalName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DOMNode的用法示例。


在下文中一共展示了DOMNode::getLocalName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: if

EppCredsOptions * EppCredsOptions::fromXML( const DOMNode& root )
{
	DOMString version;
	DOMString lang;

	DOMNodeList* list = root.getChildNodes();
	for( unsigned int i = 0; i < list->getLength(); i++ )
	{
		DOMNode* node = list->item(i);
		DOMString name = node->getLocalName();
		if( name.isNull() )
		{
			name = node->getNodeName();
		}
		if( name.isNull() )
		{
			continue;
		}
		if( name.equals("version") )
		{
			version = EppUtil::getText(*node);
		}
		else if( name.equals("lang") )
		{
			lang = EppUtil::getText(*node);
		}
	}

	if( (version.isNotNull()) && (lang.isNotNull()) )
	{
		return new EppCredsOptions(version, lang);
	}

	return null;
}
开发者ID:neustar,项目名称:registrar_toolkit,代码行数:35,代码来源:EppCredsOptions.cpp

示例2: EppAuthInfo

EppAuthInfo * EppAuthInfo::fromXML( const DOMNode& root )
{
	DOMNodeList* list = root.getChildNodes();
	for( unsigned int i = 0; i < list->getLength(); i++ )
	{
		DOMNode* node = list->item(i);
		DOMString name = node->getLocalName();
		if( name.isNull() )
		{
			name = node->getNodeName();
		}
		if( name.isNull() )
		{
			continue;
		}
//		if( name.equals("pw") )
		if( name.equals("pw") || name.equals("contact:pw") || name.equals("domain:pw") || name.equals("svcsub:pw")
			|| name.equals("xriAU:pw") || name.equals("xriINU:pw") || name.equals("xriINA:pw") || name.equals("xriISV:pw") /* Uncomment for CodeString || name.equals("xriCS:pw")*/ )
		{
			DOMElement * elm = (DOMElement *) node;
			DOMString roid = elm->getAttribute(XS("roid"));
			DOMString value = EppUtil::getText(*node);
			return new EppAuthInfo(XS(TYPE_PW), value, roid);
		}
//		else if( name.equals("ext") )
		else if( name.equals("ext") || name.equals("contact:ext") || name.equals("domain:ext") || name.equals("svcsub:ext")
			|| name.equals("xriAU:ext") || name.equals("xriINU:ext") || name.equals("xriINA:ext") || name.equals("xriISV:ext") )
		{
			return new EppAuthInfo(XS(TYPE_EXT), NULLXS);
		}
	}
	return null;
}
开发者ID:neustar,项目名称:registrar_toolkit,代码行数:33,代码来源:EppAuthInfo.cpp

示例3: findNamePoint

int DOMAttrMapImpl::findNamePoint(const XMLCh *namespaceURI,
	const XMLCh *localName) const
{
    if (fNodes == 0)
	return -1;
    // This is a linear search through the same fNodes Vector.
    // The Vector is sorted on the DOM Level 1 nodename.
    // The DOM Level 2 NS keys are namespaceURI and Localname,
    // so we must linear search thru it.
    // In addition, to get this to work with fNodes without any namespace
    // (namespaceURI and localNames are both 0) we then use the nodeName
    // as a secondary key.
    int i, len = fNodes -> size();
    for (i = 0; i < len; ++i) {
        DOMNode *node = fNodes -> elementAt(i);
        const XMLCh * nNamespaceURI = node->getNamespaceURI();
        const XMLCh * nLocalName = node->getLocalName();
        if (!XMLString::equals(nNamespaceURI, namespaceURI))    //URI not match
            continue;
        else {
            if (XMLString::equals(localName, nLocalName)
                ||
                (nLocalName == 0 && XMLString::equals(localName, node->getNodeName())))
                return i;
        }
    }
    return -1;	//not found
}
开发者ID:js422,项目名称:PERL,代码行数:28,代码来源:DOMAttrMapImpl.cpp

示例4: browseTree

void browseTree(DOMNode* root)
{
	static int indent = 1;
	indent++;

	DOMNodeList* list = root->getChildNodes();
	for( int i = 0; i < list->getLength(); i++ )
	{
		DOMNode* node = list->item(i);
		DOMString name = node->getLocalName();
		if( name.isNull() )
		{
			name = node->getNodeName();
		}
		if( name.isNull() )
		{
			continue;
		}
		if ( name.equals("#text") )
			continue;
		printDash(indent);
		cout<<name<<endl;
		browseTree(node);
	}
	indent--;
}
开发者ID:neustar,项目名称:registrar_toolkit,代码行数:26,代码来源:EppNamespaceParser.cpp

示例5: ApplyDeltaElement

void DeltaApplyEngine::ApplyDeltaElement(DOMNode* incDeltaElement) {
	vddprintf(("Apply delta element\n"));
	deltaElement = incDeltaElement;
	
	/* ---- Do All DELETE Operations ( including 'from' part of move ) ---- */
	
	vddprintf(("Apply Delete operations\n"));
	DOMNode* firstOp = deltaElement->getFirstChild() ;
	vddprintf(("    first sort delete operations...\n"));
	SortDeleteOperationsEngine deleteOps(xiddoc, firstOp);
	vddprintf(("    then apply all of them 1 by 1...\n"));
	while(!deleteOps.isListEmpty()) {
		DOMNode* op=deleteOps.getNextDeleteOperation();
		ApplyOperation(op);
		}

	vddprintf(("Ok, there are no more delete operations.\n"));
	
	/* ---- Do All INSERT Operations ( including 'to' part of move ) ---- */
	
	firstOp = deltaElement->getFirstChild() ;
	SortInsertOperationsEngine insertOps(xiddoc, firstOp);
	while(!insertOps.isListEmpty()) {
		DOMNode* op=insertOps.getNextInsertOperation();
		ApplyOperation(op);
		}
	
	/* ---- Do all  UPDATE  &  ATTRIBUTE  Operations ---- */

	DOMNode* child = deltaElement->getFirstChild() ;
	XMLCh iStr[100];
	XMLString::transcode("i", iStr, 99);
	XMLCh dStr[100];
	XMLString::transcode("d", dStr, 99);
	while (child != NULL) {
		if ( (!XMLString::equals(child->getLocalName(),iStr))
		
		   &&(!XMLString::equals(child->getLocalName(), dStr)) ) ApplyOperation(child);
	  child = child->getNextSibling() ;
		}
		
	/* ---- Small consistency checks ---- */

	if (moveDocument->getDocumentElement()->hasChildNodes()) THROW_AWAY(("temporary document used to move node is not empty!"));

	vddprintf(("xiddoc=%s\n",xiddoc->getXidMap().String().c_str() ));
}
开发者ID:alon,项目名称:xydiff,代码行数:47,代码来源:DeltaApply.cpp

示例6: fromXML

EppMarkMark* EppMarkMark::fromXML( const DOMNode& root, const char* ns)
{
	EppMarkMark *_ret    = new EppMarkMark(ns);
	DOMNodeList* list    = root.getChildNodes();

	int nsLen      = strlen(ns);

	if( list == 0 )
	{
		delete _ret;
		return NULL;
	}

	for( unsigned int i = 0; i < list->getLength(); i++ )
	{
		DOMNode* node = list->item(i);
		DOMString name = node->getLocalName();

		if( name.isNull() )
		{
			name = node->getNodeName();
		}

		if( name.isNull() )
		{
			continue;
		}
		if( name.substringData(0, nsLen + 1).equals((_ret->getNameSpace() + ":").c_str()) )
		{
			name = name.substringData(nsLen + 1, name.length() - ( nsLen + 1 ));
		}
		if( name.equals("trademark") )
		{
			EppTrademarkData *_tmd = EppTrademarkData::fromXML(*node, ns);
			if( NULL != _tmd )
			{
				_ret->_marks.addElement(_tmd);
			}
		}
		else if ( name.equals("court") )
		{
			EppCourtData *_cd = EppCourtData::fromXML(*node, ns);
			if( NULL != _cd )
			{
				_ret->_marks.addElement(_cd);
			}
		}
		else if ( name.equals("treatyOrStatute") )
		{
			EppTreatyOrStatuteData *_tsd = EppTreatyOrStatuteData::fromXML(*node, ns);
			if( NULL != _tsd )
			{
				_ret->_marks.addElement(_tsd );
			}
		}

	}
	return _ret;
}
开发者ID:neustar,项目名称:registrar_toolkit,代码行数:59,代码来源:EppMarkMark.cpp

示例7: if

EppCommandInfoLaunchRegistration* EppCommandInfoLaunchRegistration::fromXML( const DOMNode& root )
{
	EppCommandInfoLaunchRegistration* cmd  = new EppCommandInfoLaunchRegistration();
	if( cmd == null )
	{
		return null;
	}
	DOMNodeList* list      = root.getChildNodes();
	DOMNamedNodeMap* attrs = root.getAttributes();

	for( unsigned int i = 0; i < list->getLength(); i++ )
	{
		DOMNode* node  = list->item(i);
		DOMString name = node->getLocalName();
		if( name.isNull() )
		{
			name = node->getNodeName();
		}
		if( name.isNull() )
		{
			continue;
		}
		if( (name.length() > 7) && name.substringData(0, 7).equals("launch:") )
		{
			name = name.substringData(7, name.length() - 7);
		}
		if( name.equals("phase") )
		{
			EppLaunchPhase *_pptr = EppLaunchPhase::fromXML(*node);
			if( null != _pptr )
			{
				cmd->_phase = *_pptr;
				delete _pptr;
			}
			_pptr = null;
		}
		else if ( name.equals("applicationID") )
		{
			cmd->_appId = EppUtil::getText(*node);
		}
	}
	for( unsigned int i = 0;i<attrs->getLength();i++ )
	{
		DOMNode* attr = attrs->item(i);
		if( XS(attr->getNodeName()).equals("includeMark") )
		{
			DOMString _v = attr->getNodeValue();
			if( _v.length() > 0 )
			{
				if( _v.equals("true") )
				{
					cmd->includeMark(true);
				}
			}
			break;
		}
	}
	return cmd;
}
开发者ID:neustar,项目名称:registrar_toolkit,代码行数:59,代码来源:EppCommandInfoLaunchRegistration.cpp

示例8: fromXML

EppCommandCreateSecDns* EppCommandCreateSecDns::fromXML( const DOMNode &root )
{
	EppCommandCreateSecDns * cmd  = new EppCommandCreateSecDns();
	if( cmd == null )
	{
		return null;
	}

	DOMNodeList* list  = root.getChildNodes();
	for( unsigned int i = 0; i < list->getLength(); i++ )
	{
		DOMNode* node = list->item(i);
		DOMString name = node->getLocalName();

		if( name.isNull() )
		{
			name = node->getNodeName();
		}
		if( name.isNull() )
		{
			continue;
		}
		if( name.substringData(0, 7).equals("secDNS:") )
		{
			name = name.substringData(7, name.length() - 7);
		}
		if( name.equals("dsData") )
		{
			EppSecDnsDsData * ds = EppSecDnsDsData::fromXML(*node);
			if( ds != null )
			{
				cmd->add(*ds);
				delete ds;
			}
		}
		else if( name.equals("maxSigLife") )
		{
			DOMString value = EppUtil::getText(*node);
			char *p = value.transcode();
			if( p != null )
			{
				cmd->maxSigLife = ::atoi(p);
				XercesString::Delete(p);
			}
		}
		else if( name.equals("keyData") )
		{
			// FIXME(zhang) not supported
			cmd->keyDataPresent = true;
			EppSecDnsKeyData *kd = EppSecDnsKeyData::fromXML(*node);
			if( kd != null )
			{
				cmd->add(*kd);
				delete kd;
			}
		}
	}
	return cmd;
}
开发者ID:neustar,项目名称:registrar_toolkit,代码行数:59,代码来源:EppCommandCreateSecDns.cpp

示例9: if

EppCreds * EppCreds::fromXML( const DOMNode& root )
{
	DOMString clID;
	DOMString pw;
	DOMString newPW;
	EppCredsOptions * opt = null;
	EppCreds * creds = null;

	DOMNodeList* list = root.getChildNodes();
	for( unsigned int i = 0; i < list->getLength(); i++ )
	{
		DOMNode* node = list->item(i);
		DOMString name = node->getLocalName();
		if( name.isNull() )
		{
			name = node->getNodeName();
		}
		if( name.isNull() )
		{
			continue;
		}
		if( name.equals("clID") )
		{
			clID = EppUtil::getText(*node);
		}
		else if( name.equals("pw") )
		{
			pw = EppUtil::getText(*node);
		}
		else if( name.equals("newPW") )
		{
			newPW = EppUtil::getText(*node);
		}
		else if( name.equals("options") )
		{
			if( opt != null )
			{
				delete opt;
			}
			opt = EppCredsOptions::fromXML(*node);
		}
	}

	if( (clID.isNotNull()) && (pw.isNotNull()) )
	{
		creds = new EppCreds(clID, pw, newPW);
		if( opt != null )
		{
			creds->setOptions(*opt);
		}
	}

	if( opt != null )
	{
		delete opt;
	}

	return creds;
}
开发者ID:neustar,项目名称:registrar_toolkit,代码行数:59,代码来源:EppCreds.cpp

示例10: fromXMLCommon

void EppResponseInfoFeeType::fromXMLCommon( const DOMNode& root, EppResponseInfoFeeType* data )
{
	if( NULL == data )
	{
		return;
	}

	EppCommandInfoFeeType::fromXMLCommon(root, data);

	DOMNodeList* list = root.getChildNodes();

	if( NULL == list )
	{
		return;
	}

	for( unsigned int i = 0; i < list->getLength(); i++ )
	{
		DOMNode* node = list->item(i);

		if( NULL == node )
		{
			continue;
		}

		DOMString name = node->getLocalName();

		if( name.isNull() )
		{
			name = node->getNodeName();
		}
		if( name.isNull() )
		{
			continue;
		}

		if( name.equals("fee") || name.equals("fee:fee") )
		{
			EppFeeFee* f = EppFeeFee::fromXML(*node);
			if( NULL != f )
			{
				data->addFee(f);
			}
			continue;
		}
		if( name.equals("class") || name.equals("fee:class") )
		{
			data->setFeeClass(EppUtil::getText(*node));
			continue;
		}

	}
}
开发者ID:neustar,项目名称:registrar_toolkit,代码行数:53,代码来源:EppResponseInfoFeeType.cpp

示例11: runtime_error

static DOMElement *getExpectedChildElement(DOMNode *parent, string childName) {
    for(DOMNode *child = parent->getFirstChild(); child; child = child->getNextSibling()) {
        if(child->getNodeType() == DOMNode::ELEMENT_NODE && child->getLocalName() && XercesString(child->getLocalName()) == childName) {
            DOMElement *childElement = dynamic_cast<DOMElement*>(child);
            CHECK(childElement);

            return childElement;
        }
    }

    throw runtime_error((string)XercesString(parent->getLocalName()) + " missing expected child element " + childName);
}
开发者ID:CantemoInternal,项目名称:pyjames,代码行数:12,代码来源:main.cpp

示例12: lookupNamespacePrefix

const XMLCh* DOMNodeImpl::lookupNamespacePrefix(const XMLCh* const namespaceURI, bool useDefault, DOMElement *el) const {
    DOMNode *thisNode = castToNode(this);

    const XMLCh* ns = thisNode->getNamespaceURI();
    // REVISIT: if no prefix is available is it null or empty string, or
    //          could be both?
    const XMLCh* prefix = thisNode->getPrefix();

    if (ns != 0 && XMLString::equals(ns,namespaceURI)) {
        if (useDefault || prefix != 0) {
            const XMLCh* foundNamespace =  el->lookupNamespaceURI(prefix);
            if (foundNamespace != 0 && XMLString::equals(foundNamespace, namespaceURI)) {
                return prefix;
            }
        }
    }
    if (thisNode->hasAttributes()) {
        DOMNamedNodeMap *nodeMap = thisNode->getAttributes();

        if(nodeMap != 0) {
            int length = nodeMap->getLength();

            for (int i = 0;i < length;i++) {
                DOMNode *attr = nodeMap->item(i);
                const XMLCh* attrPrefix = attr->getPrefix();
                const XMLCh* value = attr->getNodeValue();

                ns = attr->getNamespaceURI();

                if (ns != 0 && XMLString::equals(ns, XMLUni::fgXMLNSURIName)) {
                    // DOM Level 2 nodes
                    if ((useDefault && XMLString::equals(attr->getNodeName(), XMLUni::fgXMLNSString)) ||
                        (attrPrefix != 0 && XMLString::equals(attrPrefix, XMLUni::fgXMLNSString)) &&
                        XMLString::equals(value, namespaceURI)) {
                        const XMLCh* localname= attr->getLocalName();
                        const XMLCh* foundNamespace = el->lookupNamespaceURI(localname);
                        if (foundNamespace != 0 && XMLString::equals(foundNamespace, namespaceURI)) {
                            return localname;
                        }
                    }
                }
            }
        }
    }
    DOMNode *ancestor = getElementAncestor(thisNode);
    if (ancestor != 0) {
        return castToNodeImpl(ancestor)->lookupNamespacePrefix(namespaceURI, useDefault, el);
    }
    return 0;
}
开发者ID:jjiezheng,项目名称:pap_full,代码行数:50,代码来源:DOMNodeImpl.cpp

示例13: if

EppCommandTransferContact * EppCommandTransferContact::fromXML( const DOMNode& root )
{
	EppCommandTransferContact * cmd = null;
	EppAuthInfo * authInfo = null;
	DOMNodeList* list = root.getChildNodes();

	for( unsigned int i = 0; i < list->getLength(); i++ )
	{
		DOMNode* node = list->item(i);
		DOMString name = node->getLocalName();

		if( name.isNull() )
		{
			name = node->getNodeName();
		}
		if( name.isNull() )
		{
			continue;
		}
		//if( name.equals("id") )
		if( name.equals("id") || name.equals("contact:id") )
		{
			DOMString id = EppUtil::getText(*node);
			if( cmd == null )
			{
				cmd = new EppCommandTransferContact(id);
			}
		}
		//else if( name.equals("authInfo") )
		else if( name.equals("authInfo") || name.equals("contact:authInfo") )
		{
			if( authInfo == null )
			{
				authInfo = EppAuthInfo::fromXML(*node);
			}
		}
	}
	if( cmd != null )
	{
		cmd->authInfo = authInfo;
	}
	else if( authInfo != null )
	{
		delete authInfo;
	}

	return cmd;
}
开发者ID:kobewang,项目名称:registrar_toolkit,代码行数:48,代码来源:EppCommandTransferContact.cpp

示例14: getDeltaElement

DOMNode* DeltaApplyEngine::getDeltaElement(XID_DOMDocument *IncDeltaDoc) {

	if (IncDeltaDoc  == NULL) THROW_AWAY(("delta document is null"));

	DOMNode* dRoot = IncDeltaDoc->getElementsByTagNameNS(XYDIFF_XYDELTA_NS, XMLString::transcode("unit_delta"))->item(0);
	if ( (dRoot==NULL)
	   ||(!XMLString::equals(dRoot->getLocalName(), XMLString::transcode("unit_delta")))) THROW_AWAY(("no <unit_delta> root found on document"));

//	const XMLCh * firstChildNodeName = dRoot->getFirstChild()->getNodeName();
//	char * firstChildNodeChar = XMLString::transcode(firstChildNodeName);
	DOMNodeList * tElementNodes = IncDeltaDoc->getElementsByTagNameNS(XYDIFF_XYDELTA_NS, XMLString::transcode("t"));
	if (tElementNodes->getLength() == 0) THROW_AWAY(("no delta element <t> found"));
//	   ||(!XMLString::equals(dRoot->getFirstChild()->getNodeName(), tempStr))) THROW_AWAY(("no delta element <t> found"));
	
//	DOMNode* deltaElement = dRoot->getFirstChild() ;
	DOMNode* deltaElement = tElementNodes->item(0);
	return deltaElement ;
	}
开发者ID:alon,项目名称:xydiff,代码行数:18,代码来源:DeltaApply.cpp

示例15: if

EppResponseDataCreateLaunchRegistration* EppResponseDataCreateLaunchRegistration::fromXML( const DOMNode& root )
{
	EppResponseDataCreateLaunchRegistration *cmd  = new EppResponseDataCreateLaunchRegistration();
	if( cmd == null )
	{
		return null;
	}
	DOMNodeList* list  = root.getChildNodes();
	for( unsigned int i = 0; i < list->getLength(); i++ )
	{
		DOMNode* node  = list->item(i);
		DOMString name = node->getLocalName();

		if( name.isNull() )
		{
			name = node->getNodeName();
		}
		if( name.isNull() )
		{
			continue;
		}
		if( (name.length() > 7) && name.substringData(0, 7).equals("launch:") )
		{
			name = name.substringData(7, name.length() - 7);
		}
		if( name.equals("phase") )
		{
			EppLaunchPhase *_pptr = EppLaunchPhase::fromXML(*node);
			if( null != _pptr )
			{
				cmd->_phase = *_pptr;
				delete _pptr;
			}
			_pptr = null;
		}
		else if( name.equals("applicationID") )
		{
			cmd->_appId = EppUtil::getText(*node);
		}
	}
	return cmd;
}
开发者ID:neustar,项目名称:registrar_toolkit,代码行数:42,代码来源:EppResponseDataCreateLaunchRegistration.cpp


注:本文中的DOMNode::getLocalName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。