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

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

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

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

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

示例1: cleanup_xml_node

/* removes all empty text, comments and other insignoficant nodes */static void cleanup_xml_node(xmlNodePtr node){	xmlNodePtr trav;	xmlNodePtr del = NULL;	trav = node->children;	while (trav != NULL) {		if (del != NULL) {			xmlUnlinkNode(del);			xmlFreeNode(del);			del = NULL;		}		if (trav->type == XML_TEXT_NODE) {			if (is_blank(trav->content)) {				del = trav;			}		} else if ((trav->type != XML_ELEMENT_NODE) &&		           (trav->type != XML_CDATA_SECTION_NODE)) {			del = trav;		} else if (trav->children != NULL) {			cleanup_xml_node(trav);		}		trav = trav->next;	}	if (del != NULL) {		xmlUnlinkNode(del);		xmlFreeNode(del);	}}
开发者ID:AmesianX,项目名称:php-src,代码行数:30,


示例2: real_run_at_node

/* * Interprets nodes from @topnode and for all of @topnode's next siblings  */static gbooleanreal_run_at_node (GdaReportEngine *engine, xmlNodePtr topnode, RunContext *context, GError **error){	xmlNodePtr node;	xmlNodePtr next_node = NULL;	for (node = topnode; node; node = next_node) {		next_node = node->next;		if (!strncmp ((gchar *) node->name, "gda_report", 10)) {			GSList *created_nodes = NULL;			gboolean cmd_res = TRUE;			gsize i;			gboolean command_found = FALSE;						for (i = 0; i < sizeof (commands) / sizeof (EngineCommand); i++) {				EngineCommand *ec = (EngineCommand *) &(commands [i]);				if (ec->has_prefix) {					if (!strcmp (((gchar *) node->name) + 10, ec->tag_name + 10)) {						command_found = TRUE;						if (ec->func)							cmd_res = (ec->func) (engine, node, &created_nodes, context, error);						break;					}				}			}			if (!command_found) {				/* gda_ node not implemented */				TO_IMPLEMENT;				g_warning ("Engine command '%s' is not yet implemented", (gchar *) node->name);			}			if (created_nodes) {				/* put @node's contents before @node */				GSList *list;				for (list = created_nodes; list; list = list->next) {					next_node = xmlAddPrevSibling (node, (xmlNodePtr) list->data);					g_assert (next_node);				}				g_slist_free (created_nodes);				/* destroy @node */				xmlUnlinkNode (node);				xmlFreeNode (node);				next_node = next_node->next;			} 			else {				/* destroy @node */				xmlUnlinkNode (node);				xmlFreeNode (node);			}			if (!cmd_res)				return FALSE;		}		else if (node->children) {			if (!real_run_at_node (engine, node->children, context, error))				return FALSE;		}	}	return TRUE;}
开发者ID:UIKit0,项目名称:libgda,代码行数:63,


示例3: gda_report_engine_set_property

static voidgda_report_engine_set_property (GObject *object,				guint param_id,				const GValue *value,				GParamSpec *pspec){        GdaReportEngine *eng;        eng = GDA_REPORT_ENGINE (object);        if (eng->priv) {                switch (param_id) {		case PROP_SPEC_NODE: {			if (eng->priv->spec) {				xmlFreeNode (eng->priv->spec);				eng->priv->spec = NULL;			}			eng->priv->spec = g_value_get_pointer (value);			break;		}		case PROP_SPEC_STRING: {			xmlDocPtr doc;						doc = xmlParseDoc (BAD_CAST g_value_get_string (value));			if (doc) {				if (eng->priv->spec) 					xmlFreeNode (eng->priv->spec);				eng->priv->spec = xmlDocGetRootElement (doc);				xmlUnlinkNode (eng->priv->spec);				if (eng->priv->doc)					xmlFreeDoc (eng->priv->doc);				eng->priv->doc = doc;			}			break;		}		case PROP_SPEC_FILE: {			xmlDocPtr doc;						doc = xmlParseFile (g_value_get_string (value));			if (doc) {				if (eng->priv->spec) 					xmlFreeNode (eng->priv->spec);				eng->priv->spec = xmlDocGetRootElement (doc);				xmlUnlinkNode (eng->priv->spec);				if (eng->priv->doc)					xmlFreeDoc (eng->priv->doc);				eng->priv->doc = doc;			}			break;		}		case PROP_OUTPUT_DIR:			g_free (eng->priv->output_dir);			eng->priv->output_dir = g_value_dup_string (value);			break;		default:			G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);			break;                }        }}
开发者ID:UIKit0,项目名称:libgda,代码行数:59,


示例4: while

void Editor_Export::processNoteCitation (xmlNodePtr node){  // Remove the note citation from the text.  xmlNodePtr child = node->xmlChildrenNode;  while (child != NULL) {    xmlNodePtr cache = child;    child = child->next;    xmlUnlinkNode (cache);    xmlFree (cache);  }    // Get more information about the footnote to retrieve.  string href;  string id;  xmlChar * property = xmlGetProp (node, BAD_CAST "href");  if (property) {    href = (char *) property;    xmlFree (property);    id = href.substr (1);  }    // Sample footnote body.  // <p class="x"><a href="#citation1" id="note1">x</a><span> </span><span>+ 2 Joh. 1.1</span></p>  // Retrieve the <a> element from it.  // At first this was done through an XPath expression:   // http://www.grinninglizard.com/tinyxml2docs/index.html  // But XPath crashes on Android.  // Therefore now it iterates of all the nodes to find the required <a> element.  xmlNodePtr aElement = get_note_pointer (xmlDocGetRootElement (document), id);  if (aElement) {    // It now has the 'a' element: Get its 'p' parent, and then remove that 'a' element.    // So we remain with:    // <p class="x"><span> </span><span>+ 2 Joh. 1.1</span></p>    xmlNodePtr pElement = aElement->parent;    xmlUnlinkNode (aElement);    xmlFree (aElement);        // Preserve active character styles in the main text, and reset them for the note.    vector <string> preservedCharacterStyles = characterStyles;    characterStyles.clear();        // Process this 'p' element.    processingNote = true;    processNode (pElement);    processingNote = false;        // Restore the active character styles for the main text.    characterStyles = preservedCharacterStyles;        // Remove this element so it can't be processed again.    xmlUnlinkNode (pElement);    xmlFree (pElement);      } else {    Database_Logs::log ("Discarding note with id " + id + " and href " + href);  }}
开发者ID:alerque,项目名称:bibledit,代码行数:58,


示例5: html_search_for_tables

/* * Handles incomplete html fragments as may occur on the clipboard, * e.g. a <td> without <tr> and <table> in front of it. */static voidhtml_search_for_tables (htmlNodePtr cur, htmlDocPtr doc,			WorkbookView *wb_view, GnmHtmlTableCtxt *tc){	htmlNodePtr ptr;	if (cur == NULL) {		xmlGenericError(xmlGenericErrorContext,				"htmlNodeDumpFormatOutput : node == NULL/n");		return;	}	if (cur->type != XML_ELEMENT_NODE)		return;	if (xmlStrEqual (cur->name, CC2XML ("table"))) {		html_read_table (cur, doc, wb_view, tc);	} else if (starts_inferred_table (cur) || starts_inferred_row (cur)) {		htmlNodePtr tnode = xmlNewNode (NULL, "table");		/* Link in a table node */		xmlAddPrevSibling (cur, tnode);		if (starts_inferred_row (cur)) {			htmlNodePtr rnode = xmlNewNode (NULL, "tr");			/* Link in a row node */			xmlAddChild (tnode, rnode);			/* Make following elements children of the row node,			 * until we meet one which isn't legal in a row. */			while ((ptr = tnode->next) != NULL) {				if (ends_inferred_row (ptr))					break;				xmlUnlinkNode (ptr);				xmlAddChild (rnode, ptr);			}		}		/* Make following elements children of the row node,		 * until we meet one which isn't legal in a table. */		while ((ptr = tnode->next) != NULL) {			if (ends_inferred_table (ptr))				break;			xmlUnlinkNode (ptr);			xmlAddChild (tnode, ptr);		}		html_read_table (tnode, doc, wb_view, tc);	} else {		for (ptr = cur->children; ptr != NULL ; ptr = ptr->next) {			html_search_for_tables (ptr, doc, wb_view, tc);			/* ptr may now have been pushed down in the tree,			 * if so, ptr->next is not the right pointer to			 * follow */			while (ptr->parent != cur)				ptr = ptr->parent;		}	}}
开发者ID:GNOME,项目名称:gnumeric,代码行数:60,


示例6: xmlCopyNode

void XMLElement::setChildren(const XMLElement & elem) const{    xmlNode *n = elem.getRealNode();    if (n && n->parent != node)    {        xmlNode *cpy = xmlCopyNode(n, 1);        xmlUnlinkNode(cpy);        xmlUnlinkNode(node->children);        xmlFreeNodeList(node->children);        node->children = 0;        xmlAddChild(node, cpy);    }}
开发者ID:ASP1234,项目名称:Scilabv5.5.2,代码行数:13,


示例7: rxml_node_remove_ex

static VALUE rxml_node_remove_ex(VALUE self){  xmlNodePtr xnode, xresult;  xnode = rxml_get_xnode(self);  /* First unlink the node from its parent. */  xmlUnlinkNode(xnode);  /* Now copy the node we want to remove and make the     current Ruby object point to it.  We do this because     a node has a number of dependencies on its parent     document - its name (if using a dictionary), entities,     namespaces, etc.  For a node to live on its own, it     needs to get its own copies of this information.*/  xresult = xmlDocCopyNode(xnode, NULL, 1);    /* Now free the original node. */  xmlFreeNode(xnode);  /* Now wrap the new node */  RDATA(self)->data = xresult;  xresult->_private = (void*) self;  /* Now return the removed node so the user can     do something with it.*/  return self;}
开发者ID:nikitug,项目名称:libxml-ruby,代码行数:27,


示例8: xmlUnlinkNode

/*Remove - removes element from xml tree*/void CXMLElement::Remove(){	if (!isinited()) return;	 xmlUnlinkNode(element);	 xmlFreeNode(element);	 element = NULL;}
开发者ID:alilloyd,项目名称:livecode,代码行数:8,


示例9: switch

bool gpl::xml::eraseNodeByXPath(){	if (m_xml->resource == NULL)		return false;	//cout<<"resource->type:"<<m_xml->resource->type<<endl;	switch (m_xml->resource->type)	{	case XPATH_NODESET://Object is a Node Set		if (m_xml->resource->nodesetval == NULL)			return false;		xmlNodePtr cur;		//取得第一个节点		if ((cur = (*(m_xml->resource->nodesetval->nodeTab))) == NULL)			return true;		xmlUnlinkNode(cur);		xmlFreeNode(cur);		cur = NULL;		break;	case XPATH_XSLT_TREE://Object is an XSLT value tree	case XPATH_BOOLEAN://Object is a Boolean	case XPATH_NUMBER://Object is a number	case XPATH_STRING://Object is a string	case XPATH_POINT://Object is a point	case XPATH_RANGE://是一个范围	case XPATH_LOCATIONSET://Object is a Location Set	case XPATH_USERS://Object is user defined	case XPATH_UNDEFINED://Object is uninitialized		return false;		break;	}	return true;}
开发者ID:zhenyouluo,项目名称:GPL,代码行数:33,


示例10: xmlNodeGetContent

voidLocal::Presentity::rename_group (const std::string old_name,				 const std::string new_name){  bool old_name_present = false;  bool already_in_new_name = false;  std::set<xmlNodePtr> nodes_to_remove;  /* remove the old name's node   * and check if we aren't already in the new name's group   */  for (xmlNodePtr child = node->children ;       child != NULL ;       child = child->next) {    if (child->type == XML_ELEMENT_NODE        && child->name != NULL) {      if (xmlStrEqual (BAD_CAST ("group"), child->name)) {	xmlChar* xml_str = xmlNodeGetContent (child);	if (xml_str != NULL) {	  if (!xmlStrcasecmp ((const xmlChar*)old_name.c_str (), xml_str)) {	    nodes_to_remove.insert (child); // don't free what we loop on!            old_name_present = true;	  }	  if (!xmlStrcasecmp ((const xmlChar*)new_name.c_str (), xml_str)) {	    already_in_new_name = true;	  }	  xmlFree (xml_str);	}      }    }  }  // ok, now we can clean up!  for (std::set<xmlNodePtr>::iterator iter = nodes_to_remove.begin ();       iter != nodes_to_remove.end ();       ++iter) {    xmlUnlinkNode (*iter);    xmlFreeNode (*iter);  }  if (old_name_present && !already_in_new_name) {    xmlNewChild (node, NULL,		 BAD_CAST "group",		 BAD_CAST robust_xmlEscape (node->doc,					    new_name).c_str ());  }  updated ();  trigger_saving ();}
开发者ID:Klom,项目名称:ekiga,代码行数:60,


示例11: delete_eag_onelevel

/*delete one level xml node*/int delete_eag_onelevel(char *fpath,char *node_name,char *attribute,char *ruler){	xmlDocPtr pdoc = NULL;	xmlNodePtr pcurnode = NULL;	char *psfilename;	int flag=-1;	psfilename = fpath;	pdoc = xmlReadFile(psfilename,"utf-8",256);  	if(NULL == pdoc)	{		return 1;	}	pcurnode = xmlDocGetRootElement(pdoc); 	pcurnode = pcurnode->xmlChildrenNode;      xmlNodePtr propNodePtr = pcurnode;		while (NULL != pcurnode)	{					if (!xmlStrcmp(pcurnode->name, BAD_CAST node_name))    		{         propNodePtr = pcurnode;			   xmlChar* szAttr = xmlGetProp(propNodePtr,BAD_CAST attribute);  		   if(!xmlStrcmp(szAttr,BAD_CAST ruler))  		   {     		            					xmlNodePtr tempNode;				  		   					tempNode = pcurnode->next;  					xmlUnlinkNode(pcurnode);					xmlFreeNode(pcurnode);					pcurnode = tempNode;			 					flag=0;					continue;			}		   xmlFree(szAttr);		}        		pcurnode = pcurnode->next; 	}	  	xmlSaveFile(fpath,pdoc); 	return flag;}
开发者ID:inibir,项目名称:daemongroup,代码行数:61,


示例12: remove_doc_from_content_list

static void remove_doc_from_content_list(xmlNodePtr cl_node, struct IdTab *id_tab,		int start, int end){    xmlNodePtr node, next;    char *str_id;    int id, i;    if (cl_node == NULL)        return;    for(node = cl_node; node != NULL; node = next)    {                next = node->next;            if (node->type == XML_ELEMENT_NODE &&	    !xmlStrcmp(node->name, (xmlChar *)"doc"))	{	    str_id = (char *)xmlGetProp(node, (xmlChar *)"docid");	    id = atoi(str_id);	    xmlFree(str_id);	    	    for(i = start; id_tab[i].id != id && i < end; i++)	        ;	    	    if (i < end && id_tab[i].id == id)	    {	        xmlUnlinkNode(node);	        xmlFreeNode((void *)node);	    }	    	}	else	    remove_doc_from_content_list(node->children, id_tab, start, end);    }}
开发者ID:Distrotech,项目名称:scrollkeeper,代码行数:34,


示例13: command_gda_report_iter_run

/* * COMMAND: <gda_report_section> * * Creates copies of its contents, one copy per row in the new run context's * data model. * * uses node's contents: yes * requested attributes: none * * REM: either "query_name" or a <gda_report_query> sub node must be provided to create a data model. */static gbooleancommand_gda_report_iter_run (GdaReportEngine *engine, xmlNodePtr node, GSList **created_nodes,			     RunContext *context, GError **error){	if (!context || !context->iter)		return TRUE;	gda_data_model_iter_move_next (context->iter);	while (gda_data_model_iter_is_valid (context->iter)) {		xmlNodePtr dup, child;		dup = xmlCopyNode (node, 1);						if (!real_run_at_node (engine, dup->children, context, error)) {			xmlFreeNode (dup);			return FALSE;		}		else {			for (child = dup->children; child; child = dup->children) {				xmlUnlinkNode (child);				*created_nodes = g_slist_prepend (*created_nodes, child);			}		}		xmlFreeNode (dup);		gda_data_model_iter_move_next (context->iter);	}	*created_nodes = g_slist_reverse (*created_nodes);	return TRUE;}
开发者ID:UIKit0,项目名称:libgda,代码行数:41,


示例14: xmlUnlinkNodeWithCheck

int xmlUnlinkNodeWithCheck(xmlNode *node) {	if (xmlNodePtrCheck(node->parent)) {		xmlUnlinkNode(node);		return 1;	}	return 0;}
开发者ID:afeld,项目名称:tangle,代码行数:7,


示例15: rxml_node_content_add

/* * call-seq: *   curr_node << "Some text"  *   curr_node << node * * Add  the specified text or XML::Node as a new child node to the  * current node. * * If the specified argument is a string, it should be a raw string  * that contains unescaped XML special characters.  Entity references  * are not supported. *  * The method will return the current node. */static VALUE rxml_node_content_add(VALUE self, VALUE obj){  xmlNodePtr xnode;  VALUE str;  Data_Get_Struct(self, xmlNode, xnode);  /* XXX This should only be legal for a CDATA type node, I think,   * resulting in a merge of content, as if a string were passed   * danj 070827   */  if (rb_obj_is_kind_of(obj, cXMLNode))  {     xmlNodePtr xtarget;    Data_Get_Struct(obj, xmlNode, xtarget);    xmlUnlinkNode(xtarget);    rxml_node_modify_dom(self, obj, xmlAddChild);  }  else  {    str = rb_obj_as_string(obj);    if (NIL_P(str) || TYPE(str) != T_STRING)      rb_raise(rb_eTypeError, "invalid argument: must be string or XML::Node");    xmlNodeAddContent(xnode, (xmlChar*) StringValuePtr(str));  }  return self;}
开发者ID:timolehto,项目名称:libxml-ruby,代码行数:41,


示例16: getListNode

    void XMLNodeList::replaceAtIndex(int index, const XMLElement & elem)    {        xmlNode *n = getListNode(index);        if (n && n != elem.getRealNode())        {            if (index == 1)            {                scope->unregisterNodeListPointer(parent->children);            }            xmlNode *previous = n->prev;            xmlNode *next = n->next;            xmlNode *cpy = xmlCopyNode(elem.getRealNode(), 1);            xmlUnlinkNode(cpy);            xmlReplaceNode(n, cpy);            xmlFreeNode(n);            prevNode = cpy;            cpy->prev = previous;            cpy->next = next;            if (index == 1)            {                scope->registerPointers(parent->children, this);            }        }    }
开发者ID:vinayrajchoudhary,项目名称:scilab,代码行数:26,


示例17: lock

void Document::importDocument(Document& other, Node& importNode){	std::lock_guard<std::mutex> lock(_lock);	// Locate the top-level node(s) of the other document	xml::NodeList topLevelNodes = other.findXPath("/*");	xmlNodePtr targetNode = importNode.getNodePtr();	if (targetNode->name == NULL)	{		// invalid importnode		return;	}	// greebo: Not all target nodes already have a valid child node, use a modified algorithm	// to handle that situation as suggested by malex984	// Add each of the imported nodes to the target importNode	for (std::size_t i = 0; i < topLevelNodes.size(); ++i)	{		if (targetNode->children == NULL)		{			xmlUnlinkNode(topLevelNodes[i].getNodePtr());			xmlAddChild(targetNode, topLevelNodes[i].getNodePtr());		}		else		{			xmlAddPrevSibling(targetNode->children, topLevelNodes[i].getNodePtr());		}	}}
开发者ID:codereader,项目名称:DarkRadiant,代码行数:32,


示例18: unlink_node

/* * call-seq: *  unlink * * Unlink this node from its current context. */static VALUE unlink_node(VALUE self){  xmlNodePtr node;  Data_Get_Struct(self, xmlNode, node);  xmlUnlinkNode(node);  return self;}
开发者ID:jmhodges,项目名称:nokogiri,代码行数:13,


示例19: remove_supported

/** * /brief Remove input plugin from supportedCollectors tag *  * /param info tool configuration * /return 0 on success */int remove_supported(conf_info_t *info){	int i;	xmlNodePtr children1;	xmlXPathObjectPtr xpath_obj_file = eval_xpath(info, TAG_SUPPORTED);	if (!xpath_obj_file) {		return 1;	}		for (i = 0; i < xpath_obj_file->nodesetval->nodeNr; i++) {		children1 = xpath_obj_file->nodesetval->nodeTab[i]->children;		while (children1) {			if ((!strncmp ((char*) children1->name, "name", strlen ("name") + 1))			        && (!xmlStrncmp (children1->children->content, (xmlChar *) info->name, xmlStrlen ((xmlChar *)info->name) + 1))) {				/* element found*/				xmlUnlinkNode(children1);				xmlFreeNode(children1);				return 0;			}			children1 = children1->next;		}	}		return 0;}
开发者ID:VisBlank,项目名称:ipfixcol,代码行数:31,


示例20: rxml_node_modify_dom

static VALUE rxml_node_modify_dom(VALUE self, VALUE target,                                  xmlNodePtr (*xmlFunc)(xmlNodePtr, xmlNodePtr)){  xmlNodePtr xnode, xtarget, xresult;  if (rb_obj_is_kind_of(target, cXMLNode) == Qfalse)    rb_raise(rb_eTypeError, "Must pass an XML::Node object");  xnode = rxml_get_xnode(self);  xtarget = rxml_get_xnode(target);  if (xtarget->doc != NULL && xtarget->doc != xnode->doc)    rb_raise(eXMLError, "Nodes belong to different documents.  You must first import the node by calling XML::Document.import");  xmlUnlinkNode(xtarget);  /* This target node could be freed here. */    xresult = xmlFunc(xnode, xtarget);  if (!xresult)    rxml_raise(&xmlLastError);  /* Was the target freed? If yes, then wrap the new node */  if (xresult != xtarget)  {    RDATA(target)->data = xresult;    xresult->_private = (void*) target;  }  return target;}
开发者ID:nikitug,项目名称:libxml-ruby,代码行数:31,


示例21: parseEnvFile

static void parseEnvFile(const char* path, xmlNodeSetPtr nodes) {	if(!path) return;	int inp = open(path,O_RDONLY);	size_t plen = strlen(path);	xmlDoc* doc = readFunky(inp,path,plen);	close(inp);	if(!doc) {		fprintf(stderr,"Couldn't parse %.*s",plen,path);		exit(5);	}	xmlNode* root = xmlDocGetRootElement(doc);	xmlNode* cur = root;  // body	nodes->nodeNr = 0;	for(;cur;cur = cur->next) {		++nodes->nodeNr;	}	nodes->nodeTab = malloc(sizeof(xmlNode*)*nodes->nodeNr);	cur = root;	int i = 0;	for(;cur;++i) {		xmlNode* next = cur->next;		nodes->nodeTab[i] = cur;		xmlUnlinkNode(cur);		cur = next;	}	xmlFreeDoc(doc);}
开发者ID:cyisfor,项目名称:htmlish,代码行数:28,


示例22: xmlRemoveDtd

/* ############################################################################# * * Description    remove all DTDs from the XML document * Author         Harry Brueckner * Date           2005-05-06 * Arguments      void * Return         void */void xmlRemoveDtd(void)  {    xmlNode*            curnode;    xmlNode*            delnode = NULL;    TRACE(99, "xmlRemoveDtd()", NULL);    if (!xmldoc)      { return; }    /* we delete all DTDs in the document */    curnode = xmldoc -> children;    while (curnode)      {        if (curnode -> type == XML_DTD_NODE)          { delnode = curnode; }        curnode = curnode -> next;        if (delnode)          {            xmlUnlinkNode(delnode);            delnode = NULL;          }      }  }
开发者ID:archi-tekt,项目名称:cpm,代码行数:34,


示例23: xml_parser_node_remove

int xml_parser_node_remove(WsXmlNodeH node){	destroy_node_private_data(((xmlNodePtr) node)->_private);	xmlUnlinkNode((xmlNodePtr) node);	xmlFreeNode((xmlNodePtr) node);	return 0;}
开发者ID:juergh,项目名称:dash-sdk,代码行数:7,


示例24: do_remove_empty

int do_remove_empty(xmlNode* node) {  xmlNode* n;  int i, is_empty, len;  xmlChar* val;  for(n = node; n; n = n->next) {    if(n->type == XML_TEXT_NODE) {      val = xmlNodeGetContent(n);      len = strlen((const char*)val);      is_empty = 1;      for(i = 0; i < len; i++) {	if(!isspace(val[i])) {	  is_empty = 0;	}      }      xmlFree(val);      if(is_empty) {	xmlUnlinkNode(n);	xmlFreeNode(n);	return 1;      }    }  }  for(n = node; n; n = n->next) {    if(n->type == XML_ELEMENT_NODE) {      do {      }while(do_remove_empty(n->children));    }  }  return 0;}
开发者ID:redsox38,项目名称:panoptes,代码行数:35,


示例25: osync_trace

OSyncXMLField *osync_xmlfield_new(OSyncXMLFormat *xmlformat, const char *name, OSyncError **error){  xmlNodePtr node = NULL;  OSyncXMLField *xmlfield = NULL;  osync_trace(TRACE_ENTRY, "%s(%p, %s, %p)", __func__, xmlformat, name, error);  osync_assert(xmlformat);  osync_assert(name);	  node = xmlNewTextChild(xmlDocGetRootElement(xmlformat->doc), NULL, BAD_CAST name, NULL);	  xmlfield = osync_xmlfield_new_node(xmlformat, node, error);  if(!xmlfield) {    xmlUnlinkNode(node);    xmlFreeNode(node);    osync_trace(TRACE_EXIT_ERROR, "%s: %s" , __func__, osync_error_print(error));    return NULL;  }  /* XMLFormat entry got added - not sure if it is still sorted */  osync_xmlformat_set_unsorted(xmlformat);  /* This XMLField has no keys, so it's for sure it's sorted */  xmlfield->sorted = TRUE;	  osync_trace(TRACE_EXIT, "%s: %p", __func__, xmlfield);  return xmlfield;}
开发者ID:ianmartin,项目名称:autoimportopensync,代码行数:27,


示例26: apply_temporary_addition

static GUPnPDIDLLiteFragmentResultapply_temporary_addition (DocNode    *modified,                          xmlNodePtr  sibling,                          xmlNodePtr  new_node,                          XSDData    *xsd_data){        xmlNodePtr mod_sibling;        xmlNodePtr new_node_copy = av_xml_util_copy_node (new_node);        if (sibling->doc == modified->doc)                mod_sibling = sibling;        else                mod_sibling = av_xml_util_find_node (modified->node, sibling);        if (mod_sibling == NULL)                return GUPNP_DIDL_LITE_FRAGMENT_RESULT_UNKNOWN_ERROR;        xmlUnlinkNode (new_node_copy);        if (xmlAddNextSibling (mod_sibling, new_node_copy) == NULL) {                xmlFreeNode (new_node_copy);                return GUPNP_DIDL_LITE_FRAGMENT_RESULT_UNKNOWN_ERROR;        }        if (!xsd_data_validate_doc (xsd_data, modified->doc))                return GUPNP_DIDL_LITE_FRAGMENT_RESULT_NEW_INVALID;        return GUPNP_DIDL_LITE_FRAGMENT_RESULT_OK;}
开发者ID:GNOME,项目名称:gupnp-av,代码行数:30,


示例27: xml_get_and_trim_names

/* Adapted from yelp-toc-pager.c */static xmlChar *xml_get_and_trim_names (xmlNodePtr node){        xmlNodePtr cur;        xmlChar *keep_lang = NULL;        xmlChar *value;        int j, keep_pri = INT_MAX;        const gchar * const * langs = g_get_language_names ();        value = NULL;        for (cur = node->children; cur; cur = cur->next) {                if (! xmlStrcmp (cur->name, GVC_SOUND_NAME)) {                        xmlChar *cur_lang = NULL;                        int cur_pri = INT_MAX;                        cur_lang = xmlNodeGetLang (cur);                        if (cur_lang) {                                for (j = 0; langs[j]; j++) {                                        if (g_str_equal (cur_lang, langs[j])) {                                                cur_pri = j;                                                break;                                        }                                }                        } else {                                cur_pri = INT_MAX - 1;                        }                        if (cur_pri <= keep_pri) {                                if (keep_lang)                                        xmlFree (keep_lang);                                if (value)                                        xmlFree (value);                                value = xmlNodeGetContent (cur);                                keep_lang = cur_lang;                                keep_pri = cur_pri;                        } else {                                if (cur_lang)                                        xmlFree (cur_lang);                        }                }        }        /* Delete all GVC_SOUND_NAME nodes */        cur = node->children;        while (cur) {                xmlNodePtr this = cur;                cur = cur->next;                if (! xmlStrcmp (this->name, GVC_SOUND_NAME)) {                        xmlUnlinkNode (this);                        xmlFreeNode (this);                }        }        return value;}
开发者ID:City-busz,项目名称:mate-media,代码行数:61,



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


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