This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Microsoft XML > December 2006 > Opening nested XML files





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Opening nested XML files
Guy

2006-12-06, 7:31 pm

I'm having trouble opening nested XML files. To open and parse an XML file I
do this:

IXMLDOMSchemaCollection* schema_cache = NULL;
ISAXXMLReader* sax2_xml_reader = NULL;
....
if (!sax2_xml_reader) return;
HRESULT hr = sax2_xml_reader->putFeature(L"schema-validation", VARIANT_FALSE);
hr = sax2_xml_reader->putFeature(L"exhaustive-errors", VARIANT_TRUE);
hr = sax2_xml_reader->putContentHandler(this);
hr = sax2_xml_reader->putErrorHandler(this);
open_tokenisers.push_back(make_pair(L"", this));
hr = sax2_xml_reader->parseURL((const
wchar_t*)filename.get_temporary_uni_chars());
if (!FAILED(hr))
{
xml_tab << "Success\n";
}
else
{
xml_tab << "Failure\n";
m_valid = false;
}
open_tokenisers.pop_back();

On one occasion, during parseURL, the code is reentered. The file parses
correctly, and the enclosing file also parses correctly. However, the next
time I execute this code to parse a subsequent XML file, I get an unhandled
exception during the call to PutContentHandler.

Anyone got any ideas?

Regards,
Guy

Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews