Re: Reading XML stream using unmanaged c++

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



In article news:<1q57m2h0r1h8nimk684rqu8e6ctql9pbk6@xxxxxxx>, Joseph M. Newcomer
wrote:
You seem to be saying that DOM would be better if it didn't provide a back
pointer? Wouldn't that just make it useless for tree structures as well as for
your linear ones?
****
How so? You don't need a back pointer to implement tree structures. We've
been building tree structures for decades without back pointers to the parent!
We taught this to beginning students in 1967. So it is not needed.

That's true, but a back pointer is a handy thing to have when using a DOM node. If
DOM didn't provide a back pointer I expect every piece of code that traversed a
DOM tree would end up building and managing back pointers of its own.

The back pointer isn't a weakness of DOM. The tree-centric nature of DOM may be a
weakness, but once you accept that DOM is tree-centric the back-pointer is just a
convenience.

I'm not responsible for lack of imagination in the user community.

No, indeed!

XLink very definitely talks about complex linked structures as an intrinsic
part of XML.

I confess I was only peripherally aware of xlink. It certainly seems to be
performing the sort of cross-linking of nodes that you've been talking about here
... but is it *part of* XML, or is it a new language built *using* XML? The
references I've scanned so far suggest the latter, but I'd need to read some (a
lot) more about it to be able to say of sure.

Sorry, XML is entirely metadata.

XML is metadata, but an XML document is an XML metadata structure with actual data
woven into it. If there were no data (as opposed to metadata) XML would be a very
great deal less useful.

I still don't understand why you're giving DOM such a hard time, though.
[snip]
Because a widely-used tool should not impose artificial restrictions on the
XML structure.

I don't think DOM would be widely-used if it weren't a useful tool. I can see that
it doesn't model the structure of the data in your application, but I don't think
it was ever intended to.

It might be nice if DOM could be extended by an application to allow it to process
metadata other than the basic XML (tree) structure -- and if that were possible I
would agree that the back-pointer should not be part of the basic tool (but that
applications should be free to add it in an extension if that made sense for their
model). However, that's not what DOM does. DOM does trees, and 95% of XML does
trees too, so that looks like quite a good fit -- to me, at least.

I'm going to stop there, because I think this discussion -- interesting though it
is -- has probably outstayed it's welcome in public.vc.mfc.

I still think you're unreasonable in blaming DOM for not being something that it
was never intended to be -- but I've made that point and can't see how I can say
anything much more; I accept that you disagree.

Thank you for opening my eyes to the fact that there *are* people out there who
really are using XML for something other than tree-shaped data. XML still doesn't
seem quite like a natural choice for that, to me, but I'll certainly consider it
further.

Cheers,
Daniel.


.



Relevant Pages

  • Re: MFC Newbie design question
    ... you could simply copy the XML Node COM pointer ... At the end of the day the tree node ... > The loaded document will be displayed in a TreeView. ...
    (microsoft.public.vc.mfc)
  • Re: lisp is winner in DOM parsing contest! 8-]
    ... > representation of the tree structure, ... elements using DOM. ... XML records - the XML document is arbitrarily large but the individual ... Pulldom passes each record to you SAX-style, ...
    (comp.lang.python)
  • Re: Writing big XML files where beginning depends on end.
    ... > We're using DOM to create XML files that describes fairly ... > complex calculations. ... The XML is structured as a big tree, ... > other values further down in the tree. ...
    (comp.lang.python)
  • Re: XSLT modifying an xml dom tree?
    ... XPath data model which is different from the DOM model) is transformed to an ouput tree there are no methods or functions inserting or adding nodes at a particular node. ... If you want help here implementing an XSLT transformation then it is usually a good idea to show us your input XML data and the desired output. ...
    (comp.text.xml)
  • Re: XML help
    ... So as I walk the tree I temporarily store IDs and DeptValues in lists. ... I then intend to create an array of size determined by the maximum value of ID. ... Obviously I'm not understanding something about XML DOM trees and Elements because when I try to print all elements I never see an end tag for any. ...
    (comp.lang.python)