Re: [xml] Potential wrong usage of xmlIsID() in tree.c



Daniel Veillard wrote:
On Thu, Feb 23, 2006 at 09:49:04PM +0100, cazic gmx net wrote:
Thinking this over again, plus taking into account what you said about
reusing the code in tree.c, I now think that the DOM-wrapper functions
should better stay in tree.c. An other Idea: what about extending the
arguments of the "internal" functions like you did for xmlCopyPropInternal()
(dunno exactly its name, don't have the code at hand) to take additional
options we need for DOM processing? This way, the normal tree functions
would work their default way and we could add semantics for DOM. So,
together with a narrow entry point like the
xmlDOMWrapDoWhateverIWantWithTheContext(xmlDOMWrapMagicCtxtPtr ctxt)
function, we could all have what we want: a flexible and reusable internal
code base, and two flavours of APIs with different semantics on top; no
special flags on docs; no additional big DOM API inside Libxml2.

  Fine by me too, more in line with the existing code. The possibility
to still be able to configure DOM specific entry point out would be
a plus (i.e. --with-tree but --without-dom).

Daniel
This works for me as well. I think we are on the same wavelength here as this was my third option when I had mentioned a lot of refactoring. I don't like the single entry point either (confusing to use). As long as we re-use existing code where possible I don't have a problem with the additional functions.

Daniel, from a non-DOM perspective, what's your view on adding auto ID-ness detection to functions like addchild, addsibling, etc... In the patch I'm working on I removed my original code for those and only fixed up some other issues, but do you want the ID stuff added there as well for consistency with the newprop, setprop functions or should detection just be left in the state it is in now? If you do think it should go in, the last question I have is creating a xml:id attribute without a parent element. Right now it marks it as an ID, but I think xmlNewPropInternal should be changed to check for a parent element first.

Rob



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