DOM is a really poor document mechanism, and in general it is very, very limited in what
it allows you to do (I wouldn't touch it with a ten-foot pole). But if you have to use
it, there are a lot of XML packages, including one from Microsoft (MSXML, I think the
acronym is). I believe it is an ActiveX interface, which means you import it into MFC and
it should work just fine.
I tend to use third-party open-source libraries like ExPat (the problem with DOM is that
you can't build graphs, either cyclic or acyclic; you are limited to trees, far to
limiting for serious work).
HTML and RTF are sort-of-unrelated; both deal with formatting and layout (while XML deals
with syntax and allows imposition of semantics on top of syntax). Do you mean how do you
parse HTML or RTF, or how do you just send them? As far as sending them, they're just
characters. As far as parsing HTML, most XML parsers can parse well-formed HTML, but HTML
is rarely well-formed (most of the ill-formed features, such as <p> without matching </p>,
have been deprecated, but they persist and a parser has to deal with them. I've written
HTML parsers, and they are Not Fun To Write because of all the syntax anomalies). rtf is
specified in a document available from Microsoft, and most new Office products and other
Microsoft products conform to the new RTF standard, but older products, third-party
products, and hand-written RTF do not have such well-behaved guarantees. It has been a
*very* long time since I last parsed RTF, but at least in the tools I was using, I recall
it was very straightforward.
On Sat, 27 May 2006 03:59:02 -0700, Harish <Harish@discussions.microsoft.com> wrote:
>I am new to DOM and XML.
>1. Certain device commands are to be stored in a reference file. The
>commands exchanged between the device and the PC should be trapped. The
>trapping component must parse through the reference file. It is recommended
>that the reference file be XML. Can I access Microsoft DOM through MFC?
>2. The commands that are exchanged are to be stored as HTML and RTF. How can
>I do it through MFC?
Joseph M. Newcomer [MVP]
MVP Tips: http://www.flounder.com/mvp_tips.htm