Validating XML against a DTD that is not supplied in the XML Schema

From: Ben Jessel (ben.jessel_at_morpheme.co.uk)
Date: 08/05/04


Date: 5 Aug 2004 04:45:21 -0700

Hi,

I'm talking the problem of trying to validate whether a rss xml feed
is well formed - i.e corresponds to the DTD and xml schema
definitions.

Given that rss comes in a number of forms:

* Sometimes a DTD is referenced
* Sometimes a schema is referenced, with namespaces
* Most of the time, no DTD or schemas or namespaces are defined.

My application requires to know whether an rss feed supplied is valid
as there is processing on the data that occurs later.

My orignal tack was to parse the data into objects ( via RSSDigester )
and then apply business logic.

However, given that functionality ( by way of DTDs and schemas )
already exists, it seems pointless to re-invent the wheel. However, my
problem is

* I can't find a library that will let me supply an XML document and a
URL to a DTD/schema which would then validate the XML.
* Even if I wrote the DTD declaration inline on the fly to the
recieved XML, given all the possible variations eg, DTD/Schema/none
specified (above), I doubt that it work.

Can anyone suggest what to do?

Regards,

Ben



Relevant Pages

  • [ANN] New XML Editor in Visual Studio 2005 Beta 1
    ... Full syntax coloring for all XML and DTD syntax. ... Intellisense based on any DTD, ... Schema picker dialog for overriding schemas used for validation, which is then remembered as a document property in your solution. ... Goto Definition command for navigating between elements and their associated DTD, XDR or XSD schema definitions. ...
    (microsoft.public.dotnet.xml)
  • Re: Help with validating XML (DTD or Schema) with PERL
    ... to handle DTD or Schemas? ... Amongst the many things I've happily & successfully done with Perl & ... parsing XML is not one. ... original thought I would easily find a FILTER to handle DTD or Schema ...
    (comp.lang.perl.modules)
  • Re: my first xml schema - I think its good. Is it really?
    ... The current recommendations are either to use just enough of a DTD to provide those and to use schema for the rest, or to use some other macro facility or to define tags for the purpose. ... XML was rushed into use before it was stable. ... but we didn't have that luxury; in order for XML to win acceptance as quickly as it did, it had to be rolled out in stages, syntax first. ...
    (comp.text.xml)
  • Re: Reading RSS XML with IE
    ... I tried parsing the RSS from this link: ... it means the XML is invalid. ... The XML contains a DTD embedded inline in the document, ... validate. ...
    (comp.lang.javascript)
  • Re: Need opinion on DTD design
    ... I would recommend looking into using a schema language (XML Schema, ... Relax NG) instead of a DTD. ... <!ELEMENT Gasoline EMPTY> ...
    (comp.text.xml)