[fpc-pascal] XML DOM stuff

Tony Pelton tpelton at gmail.com
Sat Dec 31 20:33:45 CET 2005


hi all,

i've been toiling over the DOM implementation with the FCL for a few hours now.

i had successfully used the XMLRead code to load a DOM from an XML file.

i had successfully mutated said document and used XMLWrite to persist
those changes to the DOM.

i've now been beating my head against the wall trying to figure out
how to build a DOM "from scratch" in code.

My trouble begins because it would seem that i don't get a "well
formed" document by doing a straight "Create()" of an TXMLDocument.

i've been digging around inside of the XMLRead code for a bit, trying
to understand what _it_ does to get a document going from an XML
source file.

it's confusing to me.

i see some casting and subclassing inside of the XMLRead code that
seems to allow for the creation of a well formed TXMLDocument, but i
don't see anything that leads me to a well formed API or "factory" for
being able to instantiate an "empty" but well formed XML document
myself.

minimally, i'm having problems because i can't see how to get a
DocumentElement attached to the DOM instance via a user serviceable
API call.

so i can't attach any new elements to the document after a Create().

what am i missing ?

tia,
Tony



More information about the fpc-pascal mailing list