Re: [xml] function consolidation



On Fri, Mar 25, 2005 at 09:14:42AM -0500, Rob Richards wrote:
While going through the ID stuff found that the same code needed to be 
added in many spots as code is duplicated all over the place.
Is there any reason it is done this way or just never cleaned up?

 probably it was just never cleaned up !

Here's a patch around some of the Prop functions.

Added an internal xmlNewPropInternal function which xmlNewProp, 
xmlNewNsProp and xmlNewNsPropEatName use. This will make sure these 
functions work the same as xmlNewNsProp and xmlNewNsPropEatName never 
checked the node type to insure it was an element.

  ouch, yes

Didn't add xmlNewDocProp but could easily be done with another paramter 
as well as not sure if this is a bug, but xmlNewDocProp doesnt call 
xmlEncodeEntitiesReentrant as the other ones do.

Also used xmlUnLinkNode within xmlUnsetProp and xmlUnsetNsProp. This 
will allow for any uncessary ID calls to be made properly otherwise 
would need to duplicate that code as well in those functions.

  One question and one request:
    - did it pass libxml2 and libxslt regression tests after the change ? 
    - could you send the patch as an email attachment, I'm alway vary of
      problem introduced by the changes to text made by mail software.

  thanks !

Daniel

-- 
Daniel Veillard      | Red Hat Desktop team 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]