您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ xmlAddChild函数代码示例

51自学网 2021-06-03 10:22:05
  C++
这篇教程C++ xmlAddChild函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中xmlAddChild函数的典型用法代码示例。如果您正苦于以下问题:C++ xmlAddChild函数的具体用法?C++ xmlAddChild怎么用?C++ xmlAddChild使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

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

示例1: xmlNewNode

xmlNode* CXBindingsForEachChildHandler::DoWriteResource(){	CXBindingsForEachChild* foreachchild = dynamic_cast<CXBindingsForEachChild*>(m_instance);	xmlNode* node = xmlNewNode( NULL , (const xmlChar*) "foreach_child" );		xmlNewProp( node , (const xmlChar*) "of" , cxxU2C( foreachchild->GetOf() ) );		CXBindingsArrayGrammarRule& rules = foreachchild->GetRules();	for( unsigned int i = 0; i < rules.size() ; ++i )	{		xmlNode* child = CXBindingsXmlReader::Get()->WriteResource( &(rules[i]) );		if( child != NULL )			xmlAddChild( node , child );	}	return node;}
开发者ID:nmacherey,项目名称:cxbindings,代码行数:19,


示例2: xmlFreeDoc

int Page::LoadTemplate(xmlChar * filename){  xmlNodePtr cur, newnode;  bool setit = false;  //they want us to load another template !!!  // first check if we've allready loaded one  if(templatefile)    {      xmlFreeDoc(templates);      delete templatefile;    }  wxString temp((const char*) filename, wxConvUTF8);  templatefile = temp;  templates = xmlParseFile((char *) filename);  // now we have to change the <template> in the <page>  cur = xmlDocGetRootElement(doc);  if(xmlStrcmp(cur->name, (const xmlChar *)"page") != 0)    {      xmlFreeDoc(doc);      return 0;    }  cur = cur->children;  while(cur != NULL)    {      if(!xmlStrcmp(cur->name, (const xmlChar *)"template"))        {          xmlSetProp(cur, (xmlChar *) "uri", filename);          setit = true;          break;        }      cur = cur->next;    }  if(!setit){    // seems there was no <template>, make a new one    cur = xmlDocGetRootElement(doc);    newnode = xmlNewNode(NULL, (xmlChar *) "template");    xmlAddChild(cur, newnode);  }  return true;}
开发者ID:BackupTheBerlios,项目名称:projectzero,代码行数:42,


示例3: xsltExtElementTest

/** * xsltExtElementTest: * @ctxt:  an XSLT processing context * @node:  The current node * @inst:  the instruction in the stylesheet * @comp:  precomputed informations * * Process a libxslt:test node */static voidxsltExtElementTest(xsltTransformContextPtr ctxt, xmlNodePtr node,                   xmlNodePtr inst,                   xsltElemPreCompPtr comp ATTRIBUTE_UNUSED){    xmlNodePtr commentNode;    if (testData == NULL) {        xsltGenericDebug(xsltGenericDebugContext,                         "xsltExtElementTest: not initialized,"                         " calling xsltGetExtData/n");        xsltGetExtData(ctxt, (const xmlChar *) XSLT_TESTPLUGIN_URL);        if (testData == NULL) {            xsltTransformError(ctxt, NULL, inst,                               "xsltExtElementTest: not initialized/n");            return;        }    }    if (ctxt == NULL) {        xsltTransformError(ctxt, NULL, inst,                           "xsltExtElementTest: no transformation context/n");        return;    }    if (node == NULL) {        xsltTransformError(ctxt, NULL, inst,                           "xsltExtElementTest: no current node/n");        return;    }    if (inst == NULL) {        xsltTransformError(ctxt, NULL, inst,                           "xsltExtElementTest: no instruction/n");        return;    }    if (ctxt->insert == NULL) {        xsltTransformError(ctxt, NULL, inst,                           "xsltExtElementTest: no insertion point/n");        return;    }    commentNode = xmlNewComment((const xmlChar *)                                "libxslt:testplugin element test worked");    xmlAddChild(ctxt->insert, commentNode);}
开发者ID:flaithbheartaigh,项目名称:jaikuengine-mobile-frontend,代码行数:51,


示例4: xml_Select

void xml_Select (char *msg, int entitynum, int brushnum, qboolean bError){	xmlNodePtr node, select;	char buf[1024];	char level[2];	/* now build a proper "select" XML node */	if( entitynum == 0 && brushnum < 0 )		sprintf( buf, "Worldspawn: %s", msg );	else if( entitynum == 0 )		sprintf( buf, "Brush %i: %s", brushnum, msg );	else if( brushnum < 0 )		sprintf( buf, "Entity %i: %s", entitynum, msg );	else		sprintf( buf, "Entity %i, Brush %i: %s", entitynum, brushnum, msg );	node = xmlNewNode( NULL, (xmlChar *)"select" );	xmlNodeSetContent( node, (xmlChar *)buf );	level[0] = (int)'0' + (bError ? SYS_ERR : SYS_WRN)  ;	level[1] = 0;	xmlSetProp( node, (xmlChar *)"level", (xmlChar *)&level );	/* a 'select' information */	sprintf( buf, "%i %i", entitynum, brushnum < 0 ? 0 : brushnum );	select = xmlNewNode( NULL, (xmlChar *)"brush" );	xmlNodeSetContent( select, (xmlChar *)buf );	xmlAddChild( node, select );	xml_SendNode (node);	/* print */	if( entitynum == 0 && brushnum < 0 )		sprintf( buf, "Worldspawn: %s", msg );	else if( entitynum == 0 )		sprintf( buf, "Brush %i: %s", brushnum, msg );	else if( brushnum < 0 )		sprintf( buf, "Entity %i: %s", entitynum, msg );	else		sprintf( buf, "Entity %i, Brush %i: %s", entitynum, brushnum, msg );	if( bError )		Error( buf );	else		Sys_FPrintf( SYS_NOXML, "%s/n", buf );}
开发者ID:paulvortex,项目名称:BloodMap,代码行数:42,


示例5: xml_write_guitarins

xmlNodePtr xml_write_guitarins(struct ptb_guitarin *guitarins){	struct ptb_guitarin *guitarin = guitarins;	xmlNodePtr xguitarins = xmlNewNode(NULL, "guitarins");		while(guitarin) {		xmlNodePtr xguitarin = xmlNewNode(NULL, "guitarin");		xmlAddChild(xguitarins, xguitarin);		SMART_ADD_PROP_INT(xguitarin, "offset", guitarin->offset);		SMART_ADD_PROP_INT(xguitarin, "section", guitarin->section);		SMART_ADD_PROP_INT(xguitarin, "staff", guitarin->staff);		SMART_ADD_CHILD_INT(xguitarin, "rhythm_slash", guitarin->rhythm_slash);		SMART_ADD_CHILD_INT(xguitarin, "staff_in", guitarin->staff_in);		guitarin = guitarin->next;	}	return xguitarins;}
开发者ID:Eggbert43,项目名称:ptabtools,代码行数:20,


示例6: order_dom_tree_create

static xmlNodePtrorder_dom_tree_create (GncOrder *order){    xmlNodePtr ret;    Timespec ts;    kvp_frame *kf;    ret = xmlNewNode(NULL, BAD_CAST gnc_order_string);    xmlSetProp(ret, BAD_CAST "version", BAD_CAST order_version_string);    xmlAddChild(ret, guid_to_dom_tree(order_guid_string,                                      qof_instance_get_guid(QOF_INSTANCE (order))));    xmlAddChild(ret, text_to_dom_tree(order_id_string,                                      gncOrderGetID (order)));    xmlAddChild(ret, gnc_owner_to_dom_tree (order_owner_string,                                            gncOrderGetOwner (order)));    ts = gncOrderGetDateOpened (order);    xmlAddChild(ret, timespec_to_dom_tree (order_opened_string, &ts));    ts = gncOrderGetDateClosed (order);    if (ts.tv_sec || ts.tv_nsec)        xmlAddChild(ret, timespec_to_dom_tree (order_closed_string, &ts));    maybe_add_string (ret, order_notes_string, gncOrderGetNotes (order));    maybe_add_string (ret, order_reference_string, gncOrderGetReference (order));    xmlAddChild(ret, int_to_dom_tree(order_active_string,                                     gncOrderGetActive (order)));    kf = qof_instance_get_slots (QOF_INSTANCE(order));    if (kf)    {        xmlNodePtr kvpnode = kvp_frame_to_dom_tree(order_slots_string, kf);        if (kvpnode)        {            xmlAddChild(ret, kvpnode);        }    }    return ret;}
开发者ID:mlq,项目名称:gnucash,代码行数:44,


示例7: xmlNewDoc

/**/brief Save all Components to an XML file */bool Components::Save(string filename) {    xmlDocPtr doc = NULL;       /* document pointer */    xmlNodePtr root_node = NULL, section = NULL;/* node pointers */    doc = xmlNewDoc(BAD_CAST "1.0");    root_node = xmlNewNode(NULL, BAD_CAST rootName.c_str() );    xmlDocSetRootElement(doc, root_node);	xmlNewChild(root_node, NULL, BAD_CAST "version-major", BAD_CAST "0");	xmlNewChild(root_node, NULL, BAD_CAST "version-minor", BAD_CAST "7");	xmlNewChild(root_node, NULL, BAD_CAST "version-macro", BAD_CAST "0");	for( map<string,Component*>::iterator i = components.begin(); i != components.end(); ++i ) {		section = i->second->ToXMLNode(componentName);		xmlAddChild(root_node, section);	}	xmlSaveFormatFileEnc( filename.c_str(), doc, "ISO-8859-1", 1);	xmlFreeDoc( doc );	return true;}
开发者ID:Maka7879,项目名称:Epiar,代码行数:22,


示例8: merge_two_sections

static void merge_two_sections(xmlNodePtr sect_node, xmlNodePtr other_sect_node){	xmlNodePtr node, new_node;	xmlChar *uid;		for(node = other_sect_node->children; node != NULL; node = node->next) {		if (xmlStrcmp(node->name, (xmlChar *)"doc")) {			continue;		}			uid = get_doc_uid(node);		if (uid != NULL) {			if (!find_uid_in_sect(sect_node, uid)) {				new_node = xmlCopyNode(node, 1);				check_ptr(new_node, "");				xmlAddChild(sect_node, new_node);			}		}	}}
开发者ID:Distrotech,项目名称:scrollkeeper,代码行数:20,


示例9: xmlDocCopyNode

std::shared_ptr<Node> Node::CopyIn(std::shared_ptr<const Node> nodeToCopy, bool recursive){    if ( nodeToCopy == nullptr )        return nullptr;        // complains about the difference between 'const xmlNode *' and 'xmlNode const *' ...    xmlNodePtr theCopy = xmlDocCopyNode(const_cast<_xmlNode *>(nodeToCopy->xml()), _xml->doc, recursive ? 1 : 0);    if ( theCopy == nullptr )        throw InternalError("Unable to copy node", xmlGetLastError());        xmlNode * added = xmlAddChild(_xml, theCopy);    if ( added == nullptr )    {        xmlFreeNode(theCopy);        throw InternalError("Unable to add copied node as a new child", xmlGetLastError());    }        // if added != theCopy, then theCopy has already been freed    return Wrapped<Node, _xmlNode>(added);}
开发者ID:Hasimir,项目名称:readium-sdk,代码行数:20,


示例10: return

PKI_CONFIG_ELEMENT *PKI_CONFIG_ELEMENT_new ( char *name, char *value ) {	PKI_CONFIG_ELEMENT *ret = NULL;	// xmlNsPtr ns = NULL;	if( !name ) return ( NULL );	if((ret = xmlNewNode( NULL, BAD_CAST name )) == NULL ) {		return ( NULL );	}	// ns = xmlNewNs ( ret, PKI_NAMESPACE_PREFIX, NULL );	if( value ) {		xmlAddChild( ret, xmlNewText ( BAD_CAST value ));	}	return ( ret );}
开发者ID:Brenhilt,项目名称:libpki,代码行数:20,


示例11: jal_parse_xml_snippet

enum jal_status jal_parse_xml_snippet(    xmlNodePtr *ctx_node,    const char *snippet){    if (!ctx_node || !snippet) {        return JAL_E_INVAL;    }    xmlDocPtr doc = xmlParseMemory(snippet, strlen(snippet));    if (!doc) {        return JAL_E_XML_PARSE;    }    if (*ctx_node) {        xmlAddChild(*ctx_node, xmlDocGetRootElement(doc));    }    else {        *ctx_node = xmlDocGetRootElement(doc);    }    return JAL_OK;}
开发者ID:jalop-tresys,项目名称:JALoP,代码行数:20,


示例12: xml_Point

void xml_Point( char *msg, vec3_t pt ){	xmlNodePtr node, point;	char buf[1024];	char level[2];	node = xmlNewNode( NULL, (xmlChar*)"pointmsg" );	xmlNodeSetContent( node, (xmlChar*)msg );	level[0] = (int)'0' + SYS_ERR;	level[1] = 0;	xmlSetProp( node, (xmlChar*)"level", (xmlChar *)&level );	// a 'point' node	sprintf( buf, "%g %g %g", pt[0], pt[1], pt[2] );	point = xmlNewNode( NULL, (xmlChar*)"point" );	xmlNodeSetContent( point, (xmlChar*)buf );	xmlAddChild( node, point );	xml_SendNode( node );	sprintf( buf, "%s (%g %g %g)", msg, pt[0], pt[1], pt[2] );	Error( buf );}
开发者ID:Unvanquished,项目名称:daemonmap,代码行数:20,


示例13: ENodeIsNotElement

/** * Creates a new child element node and appends it to the list * of children in "this". * * @param pcszElementName * @return */ElementNode* ElementNode::createChild(const char *pcszElementName){    // we must be an element, not an attribute    if (!m_plibNode)        throw ENodeIsNotElement(RT_SRC_POS);    // libxml side: create new node    xmlNode *plibNode;    if (!(plibNode = xmlNewNode(NULL,        // namespace                                (const xmlChar*)pcszElementName)))        throw std::bad_alloc();    xmlAddChild(m_plibNode, plibNode);    // now wrap this in C++    ElementNode *p = new ElementNode(m_pelmRoot, this, plibNode);    boost::shared_ptr<ElementNode> pNew(p);    m->children.push_back(pNew);    return p;}
开发者ID:marktsai0316,项目名称:VirtualMonitor,代码行数:27,


示例14: soap_addressing_set_to

xmlNodePtrsoap_addressing_set_to(struct SoapEnv *envelope, xmlNodePtr address){  xmlNodePtr ret;  xmlNodePtr node;  node = soap_addressing_get_to(envelope);  if (node != NULL)  {    xmlUnlinkNode(node);    xmlFreeNode(node);  }  ret = _soap_addressing_add_node(envelope->header, WSA_TO, NULL);  node = xmlCopyNode(address, 1);  xmlUnlinkNode(node);  xmlAddChild(ret, node);  return ret;}
开发者ID:ayang64,项目名称:csoap,代码行数:20,


示例15: edMove

/** *  'move' operation */static voidedMove(xmlDocPtr doc, xmlNodeSetPtr nodes, xmlNodePtr to){    int i;    for (i = 0; i < nodes->nodeNr; i++)    {        if (nodes->nodeTab[i] == (void*) doc) {            fprintf(stderr, "The document node cannot be moved./n");            exit(EXIT_INTERNAL_ERROR);        }        if (nodes->nodeTab[i]->type == XML_NAMESPACE_DECL) {            fprintf(stderr, "FIXME: can't move namespace nodes/n");            exit(EXIT_INTERNAL_ERROR);        }        /* move node */        xmlUnlinkNode(nodes->nodeTab[i]);        xmlAddChild(to, nodes->nodeTab[i]);    }}
开发者ID:cczurda,项目名称:xmlstar,代码行数:23,


示例16: xmlDocGetRootElement

voidOPENLDAP::Source::add (const std::string name,		       const std::string hostname,		       int port,		       const std::string base,		       const std::string scope,		       const std::string call_attribute,		       const std::string password){  Book *book = NULL;  xmlNodePtr root;  root = xmlDocGetRootElement (doc);  book = new Book (core, name, hostname, port, base,		   scope, call_attribute, password);  xmlAddChild (root, book->get_node ());  common_add (*book);}
开发者ID:nightfly19,项目名称:renyang-learn,代码行数:20,


示例17: design_point_to_xml_node

xmlNodePtr design_point_to_xml_node(design_point_s *p){  xmlNodePtr n = NULL;  xmlNodePtr vn = NULL;    // Sanity check parameters.  assert(p);  n = xmlNewNode(NULL, BAD_CAST "point");  if (!n) return NULL;  vn = vertex_to_xml_node(p->location);  if (vn)  {    xmlAddChild(n, xmlCopyNode(vn, 1));    xmlFreeNode(vn);  }    // Return RETVAL  return n;}
开发者ID:PatrickHead,项目名称:blue,代码行数:21,


示例18: fprintf

XmlNode *Xml::addChildNode(XmlNode *parentNode, XmlNode *childNode){    if (NULL == parentNode) {        fprintf(stderr, "[ERROR] In Xml::addChildNode, "                "parentNode == NULL/n");        return NULL;    }    if (NULL == childNode) {        fprintf(stderr, "[ERROR] In Xml::addChildNode, childNode == NULL/n");        return NULL;    }    if (NULL == _doc) {        fprintf(stderr, "[ERROR] In Xml::addChildNode, _doc == NULL/n");        return NULL;    }    return xmlAddChild(parentNode, childNode);}
开发者ID:sreadfox,项目名称:ossfs,代码行数:21,


示例19: foreach_save_func

static voidforeach_save_func (gpointer key,                   gpointer value,                   gpointer user_data){	struct save_data *sd = user_data;	xmlNodePtr new_node;	xmlChar *enc;	if (sd->type == E_XML_HASH_TYPE_OBJECT_UID) {		new_node = xmlNewNode (NULL, (xmlChar *)"object");		xmlNewProp (new_node, (xmlChar *)"uid", (const xmlChar *) key);	} else		new_node = xmlNewNode (NULL, (const xmlChar *) key);	enc = xmlEncodeEntitiesReentrant (sd->doc, value);	xmlNodeSetContent (new_node, enc);	xmlFree (enc);	xmlAddChild (sd->root, new_node);}
开发者ID:Distrotech,项目名称:evolution-data-server,代码行数:21,


示例20: gnc_book_dom_tree_create

xmlNodePtrgnc_book_dom_tree_create(QofBook *book){    xmlNodePtr ret;    G_GNUC_UNUSED gboolean allow_incompat = TRUE;    ret = xmlNewNode(NULL, BAD_CAST gnc_book_string);    xmlSetProp(ret, BAD_CAST "version", BAD_CAST gnc_v2_book_version_string);    xmlAddChild(ret, guid_to_dom_tree(book_id_string,                                      qof_book_get_guid(book)));    if (qof_instance_get_slots (QOF_INSTANCE (book)))    {        xmlNodePtr kvpnode = kvp_frame_to_dom_tree(book_slots_string,                             qof_instance_get_slots (QOF_INSTANCE (book)));        if (kvpnode)            xmlAddChild(ret, kvpnode);    }#ifdef IMPLEMENT_BOOK_DOM_TREES_LATER    /* theoretically, we should be adding all the below to the book     * but in fact, there's enough brain damage in the code already     * that we are only going to hand-edit the file at a higher layer.     * And that's OK, since its probably a performance boost anyway.     */    xmlAddChild(ret, gnc_commodity_dom_tree_create(                    gnc_commodity_table_get_table(book)));    xmlAddChild(ret, gnc_pricedb_dom_tree_create(gnc_pricedb_get_db(book)));    if (allow_incompat)    {        accnode = gnc_account_dom_tree_create(account, FALSE);        xmlAddChild (ret, rootAccNode);    }    append_account_tree (ret, gnc_book_get_root(book));    xaccAccountTreeForEachTransaction (gnc_book_get_root_account(book),                                       traverse_txns, ret);    /* xxx FIXME hack alert how are we going to handle     *  gnc_book_get_template_group handled ???   */    xmlAddChild(ret, gnc_schedXaction_dom_tree_create(                    gnc_book_get_schedxactions(book)));#endif    return ret;}
开发者ID:814ckf0x,项目名称:gnucash,代码行数:48,


示例21: doc

XmlDocHelperStatBuilder::createReport() const {    XmlDocHelper doc(xmlNewDoc((const xmlChar*) "1.0"));    XmlUtils::throwUnless(NULL != doc.get());    xmlNodePtr root = xmlNewDocNode(doc.get(), NULL, (const xmlChar*)data_->name_.c_str(), NULL);    XmlUtils::throwUnless(NULL != root);    xmlDocSetRootElement(doc.get(), root);    for(std::vector<const CounterBase*>::const_iterator c = data_->counters_.begin();        c != data_->counters_.end();        ++c) {        const CounterBase * cnt = *c;        XmlNodeHelper line = cnt->createReport();        xmlAddChild(root, line.get());        line.release();    }    return doc;}
开发者ID:bacek,项目名称:xscript,代码行数:21,


示例22: append_account_tree

static voidappend_account_tree (xmlNodePtr parent,                     Account *account,                     gboolean allow_incompat){    GList *children, *node;    children = gnc_account_get_children(account);    children = g_list_sort(children, qof_instance_guid_compare);    for (node = children; node; node = node->next)    {        xmlNodePtr accnode;        Account *account;        account = node->data;        accnode = gnc_account_dom_tree_create(account, FALSE, allow_incompat);        xmlAddChild (parent, accnode);        append_account_tree(accnode, account);    }    g_list_free(children);}
开发者ID:814ckf0x,项目名称:gnucash,代码行数:21,


示例23: xml_write_chordtexts

xmlNodePtr xml_write_chordtexts(struct ptb_chordtext *chordtexts){	xmlNodePtr xchordtexts = xmlNewNode(NULL, "chordtexts");	struct ptb_chordtext *chordtext = chordtexts;	while(chordtext) {		xmlNodePtr xchordtext = xmlNewNode(NULL, "chordtext");		xmlAddChild(xchordtexts, xchordtext);		SMART_ADD_CHILD_STRING(xchordtext, "note1", ptb_get_tone(chordtext->name[0]));		SMART_ADD_CHILD_STRING(xchordtext, "note2", ptb_get_tone(chordtext->name[1]));		SMART_ADD_PROP_INT(xchordtext, "offset", chordtext->offset);		SMART_ADD_CHILD_INT(xchordtext, "additions", chordtext->additions);		SMART_ADD_CHILD_INT(xchordtext, "alterations", chordtext->alterations);		SMART_ADD_CHILD_INT(xchordtext, "properties", chordtext->properties);		SMART_ADD_CHILD_INT(xchordtext, "VII", chordtext->VII);		chordtext = chordtext->next;	}	return xchordtexts;}
开发者ID:Eggbert43,项目名称:ptabtools,代码行数:21,


示例24: rasta_scope_add_state_xml

/* * gint rasta_scope_add_state_xml(RastaContext *ctxt, *                                xmlDocPtr doc) * * Adds XML data for the scopes to doc */gint rasta_scope_add_state_xml(RastaContext *ctxt,                               xmlDocPtr doc){    xmlNodePtr par, cur;    RastaScope *scope;    GList *elem;    g_return_val_if_fail(ctxt != NULL, -EINVAL);    g_return_val_if_fail(ctxt->scopes != NULL, -EINVAL);    g_return_val_if_fail(doc != NULL, -EINVAL);    par = xmlDocGetRootElement(doc);    g_return_val_if_fail(par != NULL, -EINVAL);    elem = ctxt->scopes;    while(elem->next != NULL)        elem = g_list_next(elem);        while (elem != NULL)    {        scope = (RastaScope *)elem->data;        g_assert(scope != NULL);        cur = xmlNewNode(NULL, "SCOPE");        if (cur == NULL)            return(-ENOMEM);        xmlSetProp(cur, "NAME", scope->id);        xmlAddChild(par, cur);        g_hash_table_foreach(scope->symbols,                             rasta_scope_build_symbol_xml,                             cur);        par = cur;        elem = g_list_previous(elem);    }    return(0);}  /* rasta_scope_add_state_xml() */
开发者ID:dineshkummarc,项目名称:rasta-0.1.4,代码行数:46,


示例25: R_processBranch

voidR_processBranch(RS_XMLParserData * rinfo,                 int branchIndex,                 const xmlChar * localname,                 const xmlChar * prefix,                 const xmlChar * URI,                 int nb_namespaces,                 const xmlChar ** namespaces,                 int nb_attributes,                 int nb_defaulted,                 const xmlChar ** attributes,		Rboolean sax1){    xmlNodePtr node;    node = xmlNewNode(NULL, localname);    if(attributes) {        const xmlChar ** p = attributes;        int i;	if(sax1) {	  for(i = 0; *p ; i += 2, p += 2)             xmlSetProp(node, p[0], p[1]); /*??? Do we need to xmlStrdup() this. */	} else {	  const xmlChar **ptr = p;	  for(i = 0; i < nb_attributes; i++, ptr += 5) {	    /*XXX does this get freed later on?*/            xmlSetProp(node, xmlStrdup(ptr[0]), getPropertyValue(ptr));	  }	}    }    if(rinfo->current) {        /* Add to children */        xmlAddChild(rinfo->current, node);    } else {        rinfo->top = node;        rinfo->branchIndex = branchIndex;    }    rinfo->current = node;}
开发者ID:SvenDowideit,项目名称:clearlinux,代码行数:39,


示例26: add_selections_to_xmlNode

static xmlNodePtradd_selections_to_xmlNode(const freesasa_selection **selections,                          xmlNodePtr parent){    xmlNodePtr xml_selection;    while (*selections) {        xml_selection = selection2xml(*selections);        if (xml_selection == NULL) {            fail_msg("");            return NULL;        }        if (xmlAddChild(parent, xml_selection) == NULL) {            fail_msg("");            xmlFreeNode(xml_selection);            return NULL;        }        ++selections;    }    return parent;}
开发者ID:mittinatten,项目名称:freesasa,代码行数:22,


示例27: SetIntValue

bool BayesianClassifier::Save(xmlNodePtr classifierNode){  int i;  bool retCode = true;  xmlNodePtr modelNode;  SetIntValue(classifierNode, DIMENSION_STR, mNumDimensions);  SetIntValue(classifierNode, CLASSES_STR, mNumClasses);  SetStringValue(classifierNode, FEATURE_STR, mFeatureString);  for (i = 0; (i < mNumClasses) && retCode; i++)  {    modelNode = xmlNewNode(NULL, (const xmlChar*)GMM_STR);    xmlAddChild(classifierNode, modelNode);    SetDoubleValue(modelNode, WEIGHT_STR, mClassWeights[i]);    retCode = mModels[i].Save(modelNode);    if ( !retCode )      fprintf(stderr, "BayesianClassifier::Save - Failed saviing GMM %d/n", i);  }  return retCode;}
开发者ID:yodergj,项目名称:HandDetection,代码行数:22,


示例28: xmlNewNode

xmlNodePtr Mission::ToXMLNode(){    char buff[256];    xmlNodePtr section = xmlNewNode(NULL, BAD_CAST "Mission" );    xmlNewChild(section, NULL, BAD_CAST "type", BAD_CAST type.c_str() );    snprintf(buff, sizeof(buff), "%d", GetVersion() );    xmlNewChild(section, NULL, BAD_CAST "version", BAD_CAST buff );    lua_State *L = Lua::CurrentState();    lua_pushstring(L,"missionTable");    PushMissionTable();    xmlAddChild(section, Lua::ConvertToXML(L, lua_gettop(L), lua_gettop(L)-1) );    lua_pop(L, 1); // Pop Table    return section;}
开发者ID:markettwp,项目名称:Epiar,代码行数:22,


示例29: GetNodeFromXPath

int CXML::AddChildNode(const char *a_chPath, const char *a_chNodeName){		int nRet = XML_OK;		xmlNodePtr pNode = NULL;		xmlNodePtr pNewNode = NULL;		nRet = GetNodeFromXPath(a_chPath, &pNode);		if(nRet != XML_OK){				XML_LOG(XML_ERR,"Node not exist(ret=%d, path=%s, attrName=%s)/n",nRet, a_chPath, a_chAttrName);				return nRet;		}		pNewNode = xmlNewNode(NULL,(const xmlChar*)a_chNodeName);		if(pNewNode == NULL){				XML_LOG(XML_ERR,"Node create failed(path=%s, name=%s)/n", a_chPath, a_chNodeName);				return XML_NODE_CREATE_FAILED;		}		xmlAddChild(pNode, pNewNode);		return XML_OK;}
开发者ID:Ntels-sup,项目名称:SRC_ATOM_BE,代码行数:22,



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


C++ xmlBufferCreate函数代码示例
C++ xml函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。