It might have been more helpful to add that if you actually want to do XSLT
or XQuery or XMLSchema processing on the document once it has been parsed,
you can ask Saxon to ask the XML parser to switch on DTD validation using
the command line option -dtd or equivalent options in the Java API.
Also, since the Xerces parser has no convenient command line interface, some
people invoke it habitually via Saxon when all they want to do is check
validity. The easiest way to do that is
java net.sf.saxon.Query -dtd:on -s:source.xml {.}
(The query "." gives you a copy of the input)
Michael Kay
http://www.saxonica.com/
> -----Original Message-----
> From: saxon-help-bounces@...
> [mailto:saxon-help-bounces@...] On Behalf
> Of Michael Kay
> Sent: 04 April 2008 01:26
> To: 'Mailing list for the SAXON XSLT and XQuery processor'
> Subject: Re: [saxon] Parse an xml against dtd
>
>
> Saxon contains many pieces of the XML jigsaw: an XSLT
> processor, an XQuery processor, an XML Schema processor, and
> an XPath processor. One thing that it doesn't contain is an
> XML parser. When you use any of these operations, Saxon makes
> calls on an external XML parser, typically the one that comes
> embedded in the Java platform (which for Sun's JDK 1.5 is a
> parser called Xerces).
>
> So the answer is that to parse an XML document and validate
> it against a DTD, you don't need Saxon, you just need an XML
> parser, and you should consult the documentation for your
> chosen parser. In practice it depends on how you want to
> invoke the parser (from a Java application, from the command
> line, from a .NET application?), and on what you want to do
> with the document once it has been parsed.
>
> Michael Kay
> http://www.saxonica.com/
>
> > -----Original Message-----
> > From: saxon-help-bounces@...
> > [mailto:saxon-help-bounces@...] On Behalf
> Of khaleek
> > ahmad
> > Sent: 03 April 2008 13:21
> > To: saxon-help@...
> > Subject: [saxon] Parse an xml against dtd
> >
> > Hi,
> >
> > Please tell me how can i parse an Xml against DTD.
> >
> >
> > Thanks & Regards
> > Khaleek Ahmad
> >
> >
> >
> > ______________________________________________________________
> > ______________________
> > You rock. That's why Blockbuster's offering you one month of
> > Blockbuster Total Access, No Cost.
> > http://tc.deals.yahoo.com/tc/blockbuster/text5.com
> >
> > --------------------------------------------------------------
> > -----------
> > Check out the new SourceForge.net Marketplace.
> > It's the best place to buy or sell services for just about anything
> > Open Source.
> > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.n
> et/marketplace
> > _______________________________________________
> > saxon-help mailing list archived at
> > http://saxon.markmail.org/ saxon-help@...
> > https://lists.sourceforge.net/lists/listinfo/saxon-help
>
>
> --------------------------------------------------------------
> -----------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for just about
> anything Open Source.
> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.n
> et/marketplace
> _______________________________________________
> saxon-help mailing list archived at
> http://saxon.markmail.org/ saxon-help@...
> https://lists.sourceforge.net/lists/listinfo/saxon-help
|