nick
2005-06-01 08:26:01 UTC
I'm facing some problems using MSXML to read an validate XML documents
that are defined in a XML schema (MSXML::DOMDocument.load() blocks
if there are errors like missing closing tag in the XML document instance
even if I don't reference a schema).
Tried to use MSXML2 but as soon as I include msxml2.h
---------------------------
namespace MSXML2
{
#include <msxml2.h>
}
---------------------------
I get compiler errors:
---------------------------
:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(3502) : error C2061: syntax error : identifier
'IXMLDOMNode'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(3679) : error C2061: syntax error : identifier
'IXMLDOMNode'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(3767) : error C2504: 'IXMLDOMDocument' : base
class undefined
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(3779) : error C2061: syntax error : identifier
'IXMLDOMParseError'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(4472) : error C2061: syntax error : identifier
'IXMLDOMParseError'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(11035) : error C2061: syntax error : identifier
'IXMLDOMNode'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(11038) : error C2061: syntax error : identifier
'IXMLDOMNode'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(11157) : error C2061: syntax error : identifier
'IXMLDOMNode'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(11169) : error C2061: syntax error : identifier
'IXMLDOMNode'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(11253) : error C2061: syntax error : identifier
'IXMLDOMNode'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(11608) : error C2061: syntax error : identifier
'IXMLDOMNode'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(19920) : error C2061: syntax error : identifier
'XML_ERROR'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(19980) : error C2061: syntax error : identifier
'XML_ERROR'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(20007) : error C2504: 'IXMLDOMNodeList' : base
class undefined
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(20016) : error C2061: syntax error : identifier
'IXMLDOMNode'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(20019) : error C2061: syntax error : identifier
'IXMLDOMNode'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(20022) : error C2061: syntax error : identifier
'IXMLDOMNode'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(20025) : error C2061: syntax error : identifier
'IXMLDOMNode'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(20029) : error C2061: syntax error : identifier
'IXMLDOMNode'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(20276) : error C2061: syntax error : identifier
'IXMLDOMNode'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(20288) : error C2061: syntax error : identifier
'IXMLDOMNode'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(20300) : error C2061: syntax error : identifier
'IXMLDOMNode'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(20312) : error C2061: syntax error : identifier
'IXMLDOMNode'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(20325) : error C2061: syntax error : identifier
'IXMLDOMNode'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(20510) : error C2061: syntax error : identifier
'IXMLDOMDocument'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(20513) : error C2061: syntax error : identifier
'IXMLDOMDocument'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(20652) : error C2061: syntax error : identifier
'IXMLDOMDocument'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(20664) : error C2061: syntax error : identifier
'IXMLDOMDocument'
Error executing clarm.exe.
xml_configDlg.obj - 28 error(s), 0 warning(s)
---------------------------
and here is the code:
---------------------------
typedef CComPtr<MSXML::IXMLDOMDocument> IXMLDOMDocumentPtr;
int CXml_configDlg::parseXML()
{
HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
if (hr == S_FALSE)
{
STLOG_WRITE(_T("COM already initialized"));
}
else if (hr != S_OK)
{
STLOG_WRITE(_T("CoInitializeEx failed"));
return -1;
}
CString sFilePath = _T("\\values.xml");
IXMLDOMDocumentPtr pXMLDoc;
COleVariant vXmlFile(sFilePath);
VARIANT_BOOL vSuccess;
hr = pXMLDoc.CoCreateInstance(__uuidof (MSXML::DOMDocument));
if (hr != S_OK)
{
STLOG_WRITE(_T("CoCreateInstance() failed"));
return -1;
}
pXMLDoc->put_validateOnParse(VARIANT_TRUE);
pXMLDoc->put_resolveExternals(VARIANT_FALSE);
pXMLDoc->put_preserveWhiteSpace(VARIANT_FALSE);
hr = pXMLDoc->load(vXmlFile,&vSuccess);
if (hr != S_OK)
{
STLOG_WRITE(_T("XML load failed"));
return -1;
}
STLOG_WRITE(_T("XML document loaded"));
return 0;
}
---------------------------
Has anyone used XML schema on PPC 2003 second edition?
Help is greatly appreciated.
/nick
that are defined in a XML schema (MSXML::DOMDocument.load() blocks
if there are errors like missing closing tag in the XML document instance
even if I don't reference a schema).
Tried to use MSXML2 but as soon as I include msxml2.h
---------------------------
namespace MSXML2
{
#include <msxml2.h>
}
---------------------------
I get compiler errors:
---------------------------
:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(3502) : error C2061: syntax error : identifier
'IXMLDOMNode'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(3679) : error C2061: syntax error : identifier
'IXMLDOMNode'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(3767) : error C2504: 'IXMLDOMDocument' : base
class undefined
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(3779) : error C2061: syntax error : identifier
'IXMLDOMParseError'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(4472) : error C2061: syntax error : identifier
'IXMLDOMParseError'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(11035) : error C2061: syntax error : identifier
'IXMLDOMNode'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(11038) : error C2061: syntax error : identifier
'IXMLDOMNode'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(11157) : error C2061: syntax error : identifier
'IXMLDOMNode'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(11169) : error C2061: syntax error : identifier
'IXMLDOMNode'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(11253) : error C2061: syntax error : identifier
'IXMLDOMNode'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(11608) : error C2061: syntax error : identifier
'IXMLDOMNode'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(19920) : error C2061: syntax error : identifier
'XML_ERROR'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(19980) : error C2061: syntax error : identifier
'XML_ERROR'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(20007) : error C2504: 'IXMLDOMNodeList' : base
class undefined
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(20016) : error C2061: syntax error : identifier
'IXMLDOMNode'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(20019) : error C2061: syntax error : identifier
'IXMLDOMNode'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(20022) : error C2061: syntax error : identifier
'IXMLDOMNode'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(20025) : error C2061: syntax error : identifier
'IXMLDOMNode'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(20029) : error C2061: syntax error : identifier
'IXMLDOMNode'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(20276) : error C2061: syntax error : identifier
'IXMLDOMNode'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(20288) : error C2061: syntax error : identifier
'IXMLDOMNode'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(20300) : error C2061: syntax error : identifier
'IXMLDOMNode'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(20312) : error C2061: syntax error : identifier
'IXMLDOMNode'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(20325) : error C2061: syntax error : identifier
'IXMLDOMNode'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(20510) : error C2061: syntax error : identifier
'IXMLDOMDocument'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(20513) : error C2061: syntax error : identifier
'IXMLDOMDocument'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(20652) : error C2061: syntax error : identifier
'IXMLDOMDocument'
c:\program files\windows ce tools\wce420\pocket pc
2003\include\armv4\msxml2.h(20664) : error C2061: syntax error : identifier
'IXMLDOMDocument'
Error executing clarm.exe.
xml_configDlg.obj - 28 error(s), 0 warning(s)
---------------------------
and here is the code:
---------------------------
typedef CComPtr<MSXML::IXMLDOMDocument> IXMLDOMDocumentPtr;
int CXml_configDlg::parseXML()
{
HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
if (hr == S_FALSE)
{
STLOG_WRITE(_T("COM already initialized"));
}
else if (hr != S_OK)
{
STLOG_WRITE(_T("CoInitializeEx failed"));
return -1;
}
CString sFilePath = _T("\\values.xml");
IXMLDOMDocumentPtr pXMLDoc;
COleVariant vXmlFile(sFilePath);
VARIANT_BOOL vSuccess;
hr = pXMLDoc.CoCreateInstance(__uuidof (MSXML::DOMDocument));
if (hr != S_OK)
{
STLOG_WRITE(_T("CoCreateInstance() failed"));
return -1;
}
pXMLDoc->put_validateOnParse(VARIANT_TRUE);
pXMLDoc->put_resolveExternals(VARIANT_FALSE);
pXMLDoc->put_preserveWhiteSpace(VARIANT_FALSE);
hr = pXMLDoc->load(vXmlFile,&vSuccess);
if (hr != S_OK)
{
STLOG_WRITE(_T("XML load failed"));
return -1;
}
STLOG_WRITE(_T("XML document loaded"));
return 0;
}
---------------------------
Has anyone used XML schema on PPC 2003 second edition?
Help is greatly appreciated.
/nick