Re: [xml] Removing all of the xml:X attributes from a node
- From: Daniel Veillard <veillard redhat com>
- To: Rush Manbert <rush manbert com>
- Cc: xml gnome org
- Subject: Re: [xml] Removing all of the xml:X attributes from a node
- Date: Fri, 17 Mar 2006 19:03:29 -0500
On Fri, Mar 17, 2006 at 03:46:46PM -0800, Rush Manbert wrote:
I am trying to write a function that removes all attributes from an
element using the tree interface. It seems that xml:lang, xml:id, and
xml:space are special cases, since they have their own get and set
functions.
Do I need to do anything special to remove these attributes from the
node?
No, they are normal attributes, only their namespace is special.
My current code for "remove all attributes" is this:
inline void
removeAllNodeAttributes (xmlNodePtr pNode)
{
xmlAttrPtr pAttr;
while (NULL != (pAttr = pNode->properties))
{
xmlRemoveProp (pAttr);
}
}
that should work. That won't remove namespace declarations, but that's
normal they are a different kind of nodes, and removing them is way harder.
Daniel
--
Daniel Veillard | Red Hat http://redhat.com/
veillard redhat com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]