Exemplo n.º 1
0
const std::string CUPnPLib::Element_GetAttributeByTag(
	IXML_Element *element, const DOMString tag) const
{
	IXML_NamedNodeMap *NamedNodeMap = ixmlNode_getAttributes(
		REINTERPRET_CAST(IXML_Node *)(element));
	IXML_Node *attribute = ixmlNamedNodeMap_getNamedItem(NamedNodeMap, tag);
	const DOMString s = ixmlNode_getNodeValue(attribute);
	std::string ret;
	if (s) {
		ret = s;
	}
	ixmlNamedNodeMap_free(NamedNodeMap);

	return ret;
}
Exemplo n.º 2
0
static char *GetNodeAttributeByName(IXML_Node *node, char *name)
{
	IXML_NamedNodeMap *nnMap = NULL;
	IXML_Node *tmpNode = NULL;
	char *value = NULL;

	nnMap = ixmlNode_getAttributes(node);
	if(nnMap == NULL)
		return NULL;
	
	tmpNode = ixmlNamedNodeMap_getNamedItem(nnMap, name);
	if(tmpNode != NULL)
		value = ixmlNode_getNodeValue(tmpNode);
	ixmlNamedNodeMap_free(nnMap);
	return value;
}