|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: c++ validating parser for xml
On Fri, 2004-01-09 at 12:24, Eliasen Jan wrote: > Hi > > I need to write a C++ program that takes an xml-document as input, and > checks that it is valid xml and also validates the xml against a DTD. > > Does anyone have any ideas where to search? I have searched Google > (naturally) and found xercesc, but that seems to be quite a package, Give LibXML a look. It might be what you need. NSGMLS is old but good. > and definately a lot more than I need, I suppose? Most others I have > found claim to be non-validating. There will not be a > DOCTYPE-declaration in my xml-files. > > Any help is appriciated. > If you want to validate against a DTD, most parsers assume you have a DOCTYPE declaration in the XML document. However, it fairly easy to work around this, for example by prepending a DOCTYPE declaration before handing the document over to the parser. (If your files have an XML declaration, you will have to strip it off before prepending the DOCTYPE.) You can also generate the DOCTYPE declaration and then include your document using an entity. /Henrik Mårtensson
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








