|
From: Joe E. <jen...@fl...> - 2001-05-08 20:34:53
|
Lee Teague <lee...@pl...> wrote:
> I've got [dom::c] compiled as an AOLServer module,
> and it seemed to be working fine (we had a little trouble getting it to compile
> with namespaces, but we figured it out. I'll send you a patch if you want)
Do you mean Tcl namespaces, XML namespaces, or C++ namespaces?
Or something else? At any rate, yes, please send a patch and I'll
get it integrated. What problems did you run into?
> I do have a question: Does dom::DOMImplementation behave differently with the C
> version?
Probably. Any differences in documented functionality should be considered
a bug though. (There are many differences in implementation details - like
the representation of nodes - but those are inconsequential).
> Here's what I'm trying to do:
> with the tcl version:
> %set doc [dom::DOMImplementation create]
> ::dom::document1(node1)
>
> the C version:
> %set doc [dom::DOMImplementation create]
> node9
>
> with the tcl version, I can then take $doc and run "dom::DOMImplementation
> serialize" on it to create the xml. But, with the C version, it says, "document
> has no document element"
That's odd; the Tcl version gives me the same error as the C version
("document has no document element"). What version of dom::tcl do you
have installed?
You need to create a root element node before serializing the
document; things should work properly then.
I think that raising an error is the correct behaviour in this case.
The documentation for [dom::DOMImplementation serialize]
says that "the text is guaranteed to be a well-formed XML document",
and there's no way to meet that guarantee unless there's exactly one
document element.
> Also, with the TCL version, doing a "namespace eval ::dom { info vars }" gives
> me "document1" (the array in the above case) and "document1var1", etc. The C
> version does not.
That's one of the inconsequential implementation details mentioned above :-)
The C version stores the tree in an internal data structure,
where the Tcl version uses Tcl variables in the ::dom namespace.
--Joe English
jen...@fl...
|