[xml] Remove all atttributes from a node



Hi all,

Another one I can't figure out from the docs or the archive.

Does anyone know how to remove all of the attributes from an element using the tree API?

My use case is that I have a xmlNodePtr to the current node (element), and a list of xmlChar* name/value pairs that represent the attributes that the element should contain. But the element already contains some unknown set of attributes that I need to remove first. (I can't just remove the current node and replace with a new one because I'm trying to retain any namespace specification that the node carries.)

It looks like I could use xmlFreePropList if I had the proper xmlAttrPtr argument to pass it, but I don't know how to get the xmlAttrPtr.

Can anyone please help me out? Is there some better way to do this?

Thanks in advance,
Rush



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]