March 5th, 2013, 09:49 AM
XML validate from DTD (lazarus)
I have an XML file loaded into a SynEdit component that I want to validate against an external DTD file...
The SynEdit component works fine for highlighting etc but I am having real trouble figuring out how to us the XML validations functions.
I've trawled over the info at http://wiki.freepascal.org/XML_Tutor...ing_a_document but am just getting myself utterly confused.
I've read the content of the DTD into a string variable so as not to have to re-read the file every time I validate and the XML to be checked is in a SynEdit component but I've completely confused myself as to how to tie the two together and parse the XML against the DTD.
I would post what I've done so far, but it's such a mess I'd be embarassed, so instead I'll explain what I've done in psuedo-code.
I get the impression I need to be doing something with TXMLDocument and TXMLInputSource but I cannot figure out what is what and any clues (especially no-cryptic ones) would be gratefully received.
myDTDcontentString, myXMLtoBeValidated: String;
Last edited by fatmonk; March 7th, 2013 at 08:53 AM.
Reason: Forgot to mention that this is in lazarus