At 02.16 17/11/2006 -0800, rohitajm wrote:

Hi,

I am new to Xerces world. I am to generate an Xml file from Visual Studio
2003. I have Windows Xp.

Uhm, why do you use the SAX parser (that reads an XML file) if you plan to generate one?


What steps I should take to create this. Is there any good tutorial for
this, please forward.

If you really want to read an XML file using the SAX2XMLParser, look at the SAX2Print example.

I am using following code in _tmain(...), but getting error: "SAX2XMLREADER:
undeclared identifier"

You are missing a #include <xercesc/sax2/SAX2XMLReader.hpp> statement

Alberto


        char* xmlFile = "x1.xml";
        SAX2XMLReader* parser = XMLReaderFactory::createXMLReader();
        parser->setFeature(XMLUni::fgSAX2CoreValidation, true); // optional
        parser->setFeature(XMLUni::fgSAX2CoreNameSpaces, true); // optional
        DefaultHandler* defaultHandler = new DefaultHandler();
        parser->setContentHandler(defaultHandler);
        parser->setErrorHandler(defaultHandler);

        try {
                parser->parse(xmlFile);
        }
        catch (const XMLException& toCatch) {
                ...
                }

Please help.

--
View this message in context: http://www.nabble.com/How-to-use-Xerces-tf2650611.html#a7396875
Sent from the Xerces - C - Users mailing list archive at Nabble.com.

Reply via email to