Click to See Complete Forum and Search --> : using DOM in C++


getzel
July 17th, 2002, 09:16 AM
how can I convert a CString or char[] with the following message "<Server>name_of_server<Server>"
to a DOM_Document .(I have to parse the info to know which server is talking to my program ).I was trying to use xerces c++ parser which uses DOM_Document. Anyone out there with suggestions??

Thanks

:)

dede
July 17th, 2002, 09:52 AM
try to see here: http://www.codeguru.com/data-misc/DdEdE.html

dkar
July 18th, 2002, 03:24 AM
I have used xerces from java, but I think the principle is the same.

You should find DocumentBuilderFactory
abstract sample:
from javax.xml.parsers import DocumentBuilderFactory
dFactory = DocumentBuilderFactory.newInstance()
dFactory.setNamespaceAware(1)
dBuilder = dFactory.newDocumentBuilder()
stream = ByteArrayInputStream( YOUR_STRING )
xmlDOM = dBuilder.parse(stream)


I do not know the details of C++ realization, but the key object is DocumentBuilder