xerces-c-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rupanu Ranjaneswar <rupanu_...@yahoo.com>
Subject newbie : DOMDocument from XML File
Date Wed, 22 Jul 2009 08:53:15 GMT
hey I just got started off with Xerces-c. I'm trying to create a DomDocument from the XML
file I have.I'm doing the following../////XercesDOMParser* itsParser = new XercesDOMParser(); DOMDocument*
domdoc = pDOMImpl->createDocument(NULL, NULL, NULL);itsParser->parse("XMLFile.xml"); domdoc
= itsParser->getDocument();////1)I want to know is there any other way to get DomDocument
directly from an XML String?2)After parsing I again write it to a file XMLFile1.xmlXMLFile1.xml file
shows encoding=UTF-16, is there any way to convert it to UTF-8 or set default encoding to
UTF-8 for DOMLSSerializer?
///////Here is how I get the string to write////
pDOMImpl = DOMImplementationRegistry::getDOMImplementation(L"LS");pSerializer = ((DOMImplementationLS*)pImplement)->createLSSerializer();
//MemoryManager 	 XMLCh* str =  pSerializer->writeToString(pDOMDocument);	 String temp
= (String)XMLString::transcode(str);

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message