Hai Joel Mueller, Thanks for ur reply.
Can u please tell how to dynamically validate a xml file against xsd when there is no reference to xsd in the xml file. Chito. ----- Original Message ----- From: "Joel Mueller" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, March 26, 2003 10:44 AM Subject: Re: [ADVANCED-DOTNET] Validating a xml file against a dtd when no dtd reference is actually in the xml document > You might want to consider converting your DTD to an XSD. The XSD > support in .NET is much better, and it's not hard at all to do what you > want with an XSD. > > > -----Original Message----- > > From: Moderated discussion of advanced .NET topics. > > [mailto:[EMAIL PROTECTED] On Behalf Of Sphinx > > Sent: Wednesday, March 26, 2003 8:43 PM > > To: [EMAIL PROTECTED] > > Subject: [ADVANCED-DOTNET] Validating a xml file against a > > dtd when no dtd reference is actually in the xml document > > > > > > Hello, > > > > How to validate a xml document against a dtd when there is no > > dtd reference in the xml document. I have used > > XMLParserContext and XmlValidatingReader classes. But, it is > > not working. I used the following code.. > > > > //PEdConfig is the name of the dtd > > > > XmlParserContext context = new XmlParserContext(null, null, > > "PEdConfig", null, null, null, "", "", XmlSpace.None); > > > > //strFileName contains name of the xml file > > > > FileStream filestreamSource = new FileStream(strFileName, > > FileMode.Open, FileAccess.Read); > > > > > > XmlValidatingReader reader = new > > XmlValidatingReader(filestreamSource, XmlNodeType.Element, context); > > > > reader.ValidationType = ValidationType.DTD; > > > > > > while(reader.Read()) > > > > { > > > > } > > > > Thanks , > > > > Chito. > > > > >
