本文整理汇总了C++中DOMNode::getNextSibling方法的典型用法代码示例。如果您正苦于以下问题:C++ DOMNode::getNextSibling方法的具体用法?C++ DOMNode::getNextSibling怎么用?C++ DOMNode::getNextSibling使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DOMNode
的用法示例。
在下文中一共展示了DOMNode::getNextSibling方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void
CADReader::componentassembly (DOMElement* element)
throw(CADReadException)
{
std::string element_name;
DOMNode* child = element->getFirstChild();
while (child != 0)
{
if (child->getNodeType() == DOMNode::ELEMENT_NODE)
{
element_name = XMLString::transcode(child->getNodeName());
//
// description
//
if (element_name == "description")
{
description((DOMElement*)(child));
}
//
// componentfiles
//
else if (element_name == "componentfiles")
{
componentfiles((DOMElement*)(child));
}
//
// partitioning
//
else if (element_name == "partitioning")
{
partitioning((DOMElement*)(child));
}
//
// connections
//
else if (element_name == "connections")
{
connections((DOMElement*)(child));
}
//
// extension
//
else if (element_name == "extension")
{
extension((DOMElement*)(child));
}
}
// get next child
child = child->getNextSibling();
}
}
示例2:
long SYSTEM::CConfigItem::GetChildCount()
{
int iCount=0;
DOMNode *child = ((DOMElement*)itemElement)->getFirstChild();
if(!child)
{
return 0;
}
while (child != 0) {
if(child->getNodeType()==DOMNode::TEXT_NODE)
{
child = child->getNextSibling();
continue;
}
iCount++;
child = child->getNextSibling();
}
return iCount;
}
示例3: fromXml
bool ScaleBarObjectImp::fromXml(DOMNode* pDocument, unsigned int version)
{
if (pDocument == NULL)
{
return false;
}
bool bSuccess = FilledObjectImp::fromXml(pDocument, version);
if (bSuccess == true)
{
mpGroup->removeAllObjects(true);
DOMNode* pObjectNode = pDocument->getFirstChild();
while (pObjectNode != NULL)
{
if (XMLString::equals(pObjectNode->getNodeName(), X("objects")))
{
DOMNode* pGroupNode = pObjectNode->getFirstChild();
while (pGroupNode != NULL)
{
if (XMLString::equals(pGroupNode->getNodeName(), X("Graphic")))
{
DOMElement* pElement(static_cast<DOMElement*> (pGroupNode));
string type(A(pElement->getAttribute(X("type"))));
GraphicObjectType objectType = StringUtilities::fromXmlString<GraphicObjectType>(type);
if (objectType == GROUP_OBJECT)
{
bSuccess = mpGroup->fromXml(pGroupNode, version);
break;
}
}
pGroupNode = pGroupNode->getNextSibling();
}
}
pObjectNode = pObjectNode->getNextSibling();
}
}
return bSuccess;
}
示例4: 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);
}
示例5: xml
vector<ImportDescriptor*> LayerImporter::getImportDescriptors(const string& filename, bool reportErrors)
{
vector<ImportDescriptor*> descriptors;
if (!filename.empty())
{
MessageLog* pLog = NULL;
if (reportErrors == true)
{
Service<MessageLogMgr> pLogMgr;
pLog = pLogMgr->getLog();
}
XmlReader xml(pLog);
XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument* pDoc = xml.parse(filename, "metadata");
DOMElement* pRootElement = NULL;
if (pDoc != NULL)
{
pRootElement = pDoc->getDocumentElement();
}
if (pRootElement != NULL)
{
for (DOMNode* pChild = pRootElement->getFirstChild();
pChild != NULL;
pChild = pChild->getNextSibling())
{
if (pChild->getNodeType() == DOMNode::ELEMENT_NODE)
{
DOMElement* pChildElement = static_cast<DOMElement*>(pChild);
string cNodeName = A(pChildElement->getNodeName());
ImportDescriptor* pImportDescriptor = ModelImporter::populateImportDescriptor(pChildElement, filename);
if (pImportDescriptor != NULL)
{
DataDescriptor* pDataDescriptor = pImportDescriptor->getDataDescriptor();
if (NULL != pDataDescriptor)
{
DynamicObject* pMetadataZ = pDataDescriptor->getMetadata();
VERIFYRV(pMetadataZ, descriptors);
if (!pMetadataZ->getAttributeByPath("Layer/Import Options/Use Pixel Coordinates").isValid())
{
pMetadataZ->setAttributeByPath("Layer/Import Options/Use Pixel Coordinates", false);
}
}
descriptors.push_back(pImportDescriptor);
}
}
}
}
}
return descriptors;
}
示例6: FindElementByName
DOMNode* DomSerializer::FindElementByName(DOMNode *node, CStdString name)
{
DOMNode *child = node->getFirstChild();
while(child)
{
if (XMLStringToLocal(child->getNodeName()) == name && child->getNodeType() == DOMNode::ELEMENT_NODE)
{
return child;
}
child = child->getNextSibling();
}
return NULL;
}
示例7: getChildElements
static vector<DOMElement*> getChildElements(DOMElement *parent) {
vector<DOMElement*> ret;
for(DOMNode *child = parent->getFirstChild(); child; child = child->getNextSibling()) {
if(child->getNodeType() == DOMNode::ELEMENT_NODE) {
DOMElement *childElement = dynamic_cast<DOMElement*>(child);
CHECK(childElement);
ret.push_back(childElement);
}
}
return ret;
}
示例8: getTagByName
DOMNode* getTagByName (DOMNode* node, std::string tagName) {
assert (node->getNodeType () == DOMNode::ELEMENT_NODE);
DOMNode* tag = 0;
DOMNode* CurNode = node->getFirstChild ();
while (CurNode != 0) {
if (std::string (XMLString::transcode (CurNode->getNodeName())) == tagName) {
cdebug << "Found..." << XMLString::transcode (CurNode->getNodeName()) << std::endl;
return CurNode;
}
CurNode = CurNode->getNextSibling ();
}
throw ("Not found");
} /* DOMNode* getTagByName (DOMNode* node, std::string tagName) */
示例9:
void
CADReader::connections (DOMElement* element)
throw(CADReadException)
{
std::string element_name;
DOMNode* child = element->getFirstChild();
while (child != 0)
{
if (child->getNodeType() == DOMNode::ELEMENT_NODE)
{
element_name = XMLString::transcode(child->getNodeName());
//
// connectinterface
//
if (element_name == "connectinterface")
{
connectinterface((DOMElement*)(child));
}
//
// connectevent
//
if (element_name == "connectevent")
{
connectevent((DOMElement*)(child));
}
//
// connecthomes
//
if (element_name == "connecthomes")
{
connecthomes((DOMElement*)(child));
}
//
// extension
//
if (element_name == "extension")
{
extension((DOMElement*)(child));
}
}
// get next child
child = child->getNextSibling();
}
}
示例10: while
XERCES_CPP_NAMESPACE_QUALIFIER DOMElement *ParameterGrp::FindNextElement(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *Prev, const char* Type) const
{
DOMNode *clChild = Prev;
if (!clChild) return 0l;
while ((clChild = clChild->getNextSibling())!=0) {
if (clChild->getNodeType() == DOMNode::ELEMENT_NODE) {
// the right node Type
if (!strcmp(Type,StrX(clChild->getNodeName()).c_str())) {
return (DOMElement*)clChild;
}
}
}
return NULL;
}
示例11: printEntityRefNodes
void Normalizer::printEntityRefNodes(DOMElement *ele) {
DOMNode *child = ele->getFirstChild();
while(child != 0) {
if(child->getNodeType() == DOMNode::ENTITY_REFERENCE_NODE) {
XERCES_STD_QUALIFIER cout << "start of entity ref node" << XERCES_STD_QUALIFIER endl;
DOMNode *entChild = ((DOMEntityReference*)child)->getFirstChild();
while(entChild != 0) {
serializeNode(entChild);
entChild = entChild->getNextSibling();
}
XERCES_STD_QUALIFIER cout << "\nend of entity ref node\n\n" << XERCES_STD_QUALIFIER endl;
}
if(child->getNodeType() == DOMNode::ELEMENT_NODE) {
printEntityRefNodes((DOMElement*)child);
}
child = child->getNextSibling();
}
}
示例12: getNextSiblingElement
// Finds and returns the last child element node.
DOMElement* XUtil::getNextSiblingElement(const DOMNode* const node)
{
// search for node
DOMNode* sibling = node->getNextSibling();
while (sibling != 0)
{
if (sibling->getNodeType() == DOMNode::ELEMENT_NODE)
return (DOMElement*)sibling;
sibling = sibling->getNextSibling();
}
// not found
return 0;
}
示例13: getSubAlgorithm
bool ConfigurationFileHandler::getSubAlgorithm(std::string algorithm, std::string subalgorithm, std::string* result){
#ifdef BRICS_XERCES_ENABLE
if (errorsOccured) {
return false;
}
DOMNode* current = NULL;
DOMNode* attributeNode = NULL;
XMLCh* algorithmName = XMLString::transcode(algorithm.c_str());
XMLCh* subAlgorithmName = XMLString::transcode(subalgorithm.c_str());
XMLCh* implementationString = XMLString::transcode("implementation");
bool subAlgorithmFound = false;
DOMDocument* doc = parser->getDocument();
DOMNodeList* root = doc->getElementsByTagName(algorithmName);
if (root->getLength() > 1) {
LOG(WARNING) << "More than one " << algorithm << " found, taking the first one";
} else if(root->getLength() < 1) {
LOG(WARNING) << "No algorithm called " << algorithm << " found.";
return false; //TODO release resouces
}
current = root->item(0);
//search in children notes
for (current = current->getFirstChild()->getNextSibling(); current!=NULL; current = current->getNextSibling()) {
string nodeName = XMLString::transcode(current->getNodeName());
if (nodeName.compare(subalgorithm) == 0) {
DOMNamedNodeMap* attributesList = current->getAttributes();
attributeNode = attributesList->getNamedItem(implementationString);
if (attributeNode != 0) {
*result = XMLString::transcode(attributeNode->getNodeValue());
subAlgorithmFound = true;
break; //take only first found
}
}
}
XMLString::release(&algorithmName);
XMLString::release(&subAlgorithmName);
XMLString::release(&implementationString);
return subAlgorithmFound;
#else
return false;
#endif
}
示例14: xiu
XERCES_CPP_NAMESPACE_BEGIN
DOMDocument *
XIncludeDOMDocumentProcessor::doXIncludeDOMProcess(const DOMDocument * const source, XMLErrorReporter *errorHandler, XMLEntityHandler* entityResolver /*=NULL*/){
XIncludeUtils xiu(errorHandler);
DOMImplementation* impl = source->getImplementation();
DOMDocument *xincludedDocument = impl->createDocument();
try
{
/* set up the declaration etc of the output document to match the source */
xincludedDocument->setDocumentURI( source->getDocumentURI());
xincludedDocument->setXmlStandalone( source->getXmlStandalone());
xincludedDocument->setXmlVersion( source->getXmlVersion());
/* copy entire source document into the xincluded document. Xincluded document can
then be modified in place */
DOMNode *child = source->getFirstChild();
for (; child != NULL; child = child->getNextSibling()){
if (child->getNodeType() == DOMNode::DOCUMENT_TYPE_NODE){
/* I am simply ignoring these at the moment */
continue;
}
DOMNode *newNode = xincludedDocument->importNode(child, true);
xincludedDocument->appendChild(newNode);
}
DOMNode *docNode = xincludedDocument->getDocumentElement();
/* parse and include the document node */
xiu.parseDOMNodeDoingXInclude(docNode, xincludedDocument, entityResolver);
xincludedDocument->normalizeDocument();
}
catch(const XMLErrs::Codes)
{
xincludedDocument->release();
return NULL;
}
catch(...)
{
xincludedDocument->release();
throw;
}
return xincludedDocument;
}
示例15: if
void
CCDReader::corbacomponent (DOMElement* element)
throw(CCDReadException)
{
std::string repid_of_home;
DOMNode* child = element->getFirstChild();
while (child != 0)
{
if (child->getNodeType() == DOMNode::ELEMENT_NODE)
{
//
// homerepid
//
if (!XMLString::compareString(child->getNodeName(), X("homerepid")))
{
data_->home_repid = homerepid((DOMElement*)child);
}
//
// homefeatures
//
else if (!XMLString::compareString(child->getNodeName(), X("homefeatures")))
{
}
//
// componentkind
//
else if (!XMLString::compareString(child->getNodeName(), X("componentkind")))
{
componentkind( (DOMElement*)child );
}
//
// componentfeatures
//
else if (!XMLString::compareString(child->getNodeName(), X("componentfeatures")))
{
componentfeatures( (DOMElement*) child);
}
}
// get next child
child = child->getNextSibling();
}
}