MSXML SAX parsing with C code

Tech-Archive recommends: Fix windows errors by optimizing your registry




Hi,


I am trying to parse an xml file using MSXML SAX parser in C. I dont
find any examples on how to proceed. I have just started with the
below code . Please guide me or give reference links on how to parse
using sax parser and C code.

HRESULT hr;
ISAXXMLReader* m_pReader = NULL;
BSTR bstr = NULL;
VARIANT_BOOL status;
VARIANT vSrc,value;

hr = CoInitialize(NULL);
if(hr != S_OK)
return 0;

hr = CoCreateInstance(&CLSID_SAXXMLReader30, NULL,
CLSCTX_SERVER,&IID_ISAXXMLReader, (void**)&m_pReader);

if (FAILED(hr))
{
printf("Failed to CoCreate an instance of an XML DOM\n");
printf("Error code: %x\n", hr);
return 1;
}

VariantInit(&vSrc);
V_BSTR(&vSrc) = SysAllocString(L"sample.xml");
V_VT(&vSrc) = VT_BSTR;

m_pReader->lpVtbl->parse(m_pReader,vSrc);



Please guide me on how to proceed with parsing.

Thanks friends,
Andy

.



Relevant Pages

  • xerces/SAX xml search
    ... find locations (line/column) of certain elements and attributes within ... will search through an xml file as it parses. ... SAX parser and an empty handler. ... the parse search. ...
    (comp.text.xml)
  • One favour plz.
    ... Can you plz tell me one thing like I have one XML file which is already ... I want to parse that File1.xml file and save it into database through any ... I would highly appreciate if any one guide me this. ...
    (microsoft.public.sqlserver.clients)
  • Strange performance behavior of IXMLDOMNode>>text in DPRO 5.1.4
    ... I have come a quite a way in building my own framework to parse a particular XML file (that contains information about audio tracks). ... After some more experimentation I also found that the bigger the XML file was, the longer each method execution took, even if it was for the same node at the same position. ...
    (comp.lang.smalltalk.dolphin)
  • RE: Bug in MSXML / XML Parser .Net
    ... > I have a problem parsing XML file using XSLT stylesheet by using: ... > System.Xml.XPath.MethodOperand.SetXsltContext(XsltContext context) ... > When I use XMLSpy to parse the XML using MSXML 4 processor it works perfect. ...
    (microsoft.public.dotnet.xml)
  • Re: How to get data from txt file into table of word template thro
    ... XLST file to transform the XML file into the output you need? ... I have a word document which has a lot of tables ... There's no way to answer the question about whether VBA is the best ... For the XML data source file, you said Word can parse it by itself. ...
    (microsoft.public.word.vba.general)