Re: Confused About Validation

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Zafar Abbas [MSFT] (zafara_at_microsoft.com)
Date: 09/18/04


Date: Fri, 17 Sep 2004 18:06:12 -0700

XmlSchemaCollection can only add XSD and XDR schemas.
DTDs have to be included or referred from an XML file.

"Fruber Malcome" <fruber_malcome@msn.com> wrote in message
news:Ovrixx2mEHA.3988@tk2msftngp13.phx.gbl...
> Could either of you or anyone answer this question - or tell me if it's
> possible?
>
> I have this collection of XML files that do not define a doctype,
therefore
> explorer etc just says that a particular entity is undeclared.
> When using a validator so that I can validate the xml file, I create an
> XmlValidatingReader, setting the validation type to DTD.
> Then I add both the dtd and an entities.txt file (which is all the
entities
> defined in xml format).
>
> When the SchemaCollection tries to .Add (null, dtdFile) - I get an
exception
> saying that Doctype is not defined.
> When looking at the dtd, it looks like a normal dtd file - but there too
is
> no doctype being define.
>
> Without having to modify every xml file to have a docType, is there
> something I can do to this dtd file so that the SchemaCollection will add
> it, then use it to load / validate the xml files?
>
> Any help would be appreciated.
>
> thanks - bill
>
>
>
> "Martin Honnen" <mahotrash@yahoo.de> wrote in message
> news:efTlsWLbEHA.1732@TK2MSFTNGP09.phx.gbl...
> >
> >
> > Wayne Wengert wrote:
> >
> >> I have an XML document and a corresponding xsd document I built. I want
> >> to
> >> validate the xml document against that Schema but when I use the MSDN
> >> validator it has no place to select the xsd document? It has a
checkmark
> >> for
> >> "Validate" but I have no idea what it is using as the Schema?
> >>
> >> Where can I find a validator that lets me specify the xml document and
> >> the
> >> xsd Schema to use for validation?
> >
> > As you are asking in the dotnet group here is a web interface to some
> > validator written using the .NET classes:
> > http://apps.gotdotnet.com/xmltools/xsdvalidator/
> > Of course it is rather easy and indeed described in the .NET SDK how to
> > write a short C# program performing the validation yourself.
> >
> > --
> >
> > Martin Honnen
> > http://JavaScript.FAQTs.com/
> >
>
>



Relevant Pages

  • Re: Specifying a DTD for a DOMDocument
    ... against a DTD if load the XML file. ... Seems that the validate() function only works when loading xml files. ...
    (comp.lang.php)
  • Re: How to read an XML file in Visual C++ 6
    ... the DTD could be part of the XML file itself ... I'd vote for putting it in the resources. ... It makes no sense to put a remote URL into a file which is going to be used locally. ...
    (microsoft.public.vc.mfc)
  • validating xml against DTD
    ... I am using the following code to validate an xml file ... against a DTD. ... I force the requirement to declare the DTD in the XML ... Private Function validate() As Boolean ...
    (microsoft.public.dotnet.languages.vb)
  • Serializing from XML with remote DTD
    ... I have an XML file which I am serializing into a class using the ... the XML file has a dtd in it that points to a remote ... mean, it's not trying to validate it, so why ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Convert flat file to XML document
    ... >I am a newbee and have a comma seperated flat-file and a DTD. ... >XML file as per the the definition in the DTD. ... As required add extra processing to your program so that you can ... The ultimate truth is that there is no ultimate truth ...
    (microsoft.public.dotnet.languages.csharp)