??Best way to validate an external dtd

admin

Administrator
Staff member
I am looking for some assistance as to the best way to validate XML againstan external DTD using MSXML 3.0 XMLDOM, ASP and/or VB6. I am taking in aXML string via a HTTP Post to my ASP page.Where is the best place for the DTD to reside? Do I make a customer putin a physical path or a URL into the !DOCTYPE tag that points to my DTD onmy server? In ASP I had success with the URL, but I have been limited tophysical path when validating from a VB6 DLL. I created the DLL because Iwas unsuccessful in trying to ensure that a !DOCTYPE was sent in the XMLstring.I found that the following code will not return an error when no !DOCTYPEtag is declared in the XML string.Set oXmlDoc = Server.CreateObject("Msxml2.DOMDocument")oXmlDoc.async="false"oXmlDoc.resolveExternals = TrueoXmlDoc.validateOnParse = TrueoXmlDoc.loadXML(sRequestTransmission)If oXmlDoc.parseError.reason = "" Then ...I tried declaring and interrogating an XMLDOMDocumentType object in ASP butthe following codereturned an object required error even when a valid !DOCTYPE tag existed.Set oXmlDocType = oXmlDoc.doctypesDocTypeName = oXmlDocType.NameIn my VB6 DLL this code is fine and I trap an error if no !DOCTYPE tag exists.Does anyone have any suggestions?
 
Back
Top