OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] DTD parser in c#

[ Lists Home | Date Index | Thread Index ]

> I need a DTD parser to parse the element in the DTD and match with the
DAML
> (ontology file). According to your expertise experience, will SAX.NET help
> me in this issue? Thanks for your reply.

Yes and no. What SAX will give you is a standard way to list all of the
declarations in a DTD without having to write your parser-- which is tough.
It will also expand all of the parameter entities for you. Ultimately
though, you will still have a lot of work to do with SAX. You will probably
have to do something like :

(1) Set up a DeclHandler on the SAX XMLReader.

(2) Record all of the items from ElementDecl, AttributeDecl, etc. events
into a Hashtable or Dictionary.

(3) As you encounter a DAML element match it using a lookup in the Hashtable
or Dictionary.

In this respect, you are not saving much over using the DOM-- and still have
at least some amount of work to do. However, in SAX you do have more options
for providing your own DTD for a specific file (e.g., getExternalSubset,
InputSource)

All the best,
Jeff





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS