Discussion:
Need help with XPath and MSXML 4.0
(too old to reply)
malhenry
2006-05-16 15:26:02 UTC
Permalink
Please note I am using VS C++ 6.0 and NOT .NET.

I am getting zero for my count of nodes in the list returned by selectNodes.
It looks like I need to call setProperty(SelectionLanguage,"XPath") first,
but in my code below, setProperty is NOT a valid method for the pDoc object.

Any suggestions on what I can do?

HRESULT APCCheckXML::LoadDocumentSync(MSXML::IXMLDOMDocument* pDoc, BSTR
pBURL)
{
MSXML::IXMLDOMParseError* pXMLError = NULL;
VARIANT vURL;
VARIANT_BOOL vb; // valid vars are zero and MINUS one
HRESULT hr;

CHECKHR(pDoc->put_async(VARIANT_FALSE));
CHECKHR(pDoc->put_validateOnParse(VARIANT_FALSE));

// Load xml document from the given URL or file path

VariantInit(&vURL);
vURL.vt = VT_BSTR;
V_BSTR(&vURL) = pBURL;

// Note if vURL contains a non-existent file or does not have the full file
path
// you will get 3 occurrences of:
// First-chance exception in capgen.exe (KERNEL32.DLL): 0xE0000001: (no
name).

CHECKHR(pDoc->load(vURL, &vb));

CHECKHR(CheckLoad(pDoc));

CleanUp:
SAFERELEASE(pXMLError);

return hr;
}

// Here is the XPath call from another method that does not work

hr = pTraStatisticsNode->selectNodes((unsigned short *"//Tra/incident"),
&pXMLChildNodeList);

Here is the xml file:

<?xml version="1.0" encoding="ISO-8859-1" ?>
- <Tra>
<date>06-05-15</date>
<time>08:40:25</time>
<city>TO</city>
<sector>CC</sector>
- <incident>
<active>1</active>
<route>401</route>
<direction>WB Express</direction>
<location>between</location>
<route>Jane</route>
<incident>Construction</incident>
<lane>Right lane</lane>
</incident>
<city>TO</city>
<sector>CE</sector>
- <incident>
<active>1</active>
<route>Gerrard</route>
<direction>Both ways</direction>
<location>east of</location>
<route>Coxwell</route>
<incident>Construction</incident>
<lane>Right lane</lane>
</incident>
<city>TO</city>
<sector>CC</sector>
- <incident>
<active>1</active>
<route>401</route>
<direction>EB Col-Exp</direction>
<location>at</location>
<route>400</route>
<incident>Closed repairs</incident>
<lane />
</incident>
<city>TO</city>
<sector>NC</sector>
- <incident>
<active>1</active>
<route>Yonge</route>
<direction />
<location>at</location>
<route>407</route>
<incident>Broken watermain</incident>
<lane />
</incident>
<city>TO</city>
<sector>CC</sector>
- <incident>
<active>1</active>
<route>Sheppard</route>
<direction />
<location>east of</location>
<route>Bathurst</route>
<incident>Closed repairs</incident>
<lane>All Lanes</lane>
</incident>
<city>TO</city>
<sector>SE</sector>
- <incident>
<active>1</active>
<route>DVP</route>
<direction>SB</direction>
<location>at</location>
<route>Don Roadway</route>
<incident>Lights out</incident>
<lane />
</incident>
<city>TO</city>
<sector>NW</sector>
- <incident>
<active>1</active>
<route>7</route>
<direction />
<location>at</location>
<route>Jane</route>
<incident>Closed repairs</incident>
<lane>All Lanes</lane>
</incident>
<city>TO</city>
<sector>CC</sector>
- <incident>
<active>1</active>
<route>Yonge</route>
<direction>NB</direction>
<location>past</location>
<route>Lawrence</route>
<incident>Collision</incident>
<lane />
</incident>
<city>TO</city>
<sector>CW</sector>
- <incident>
<active>1</active>
<route>400</route>
<direction>SB</direction>
<location>at</location>
<route>401</route>
<incident>Collision</incident>
<lane>Center lane</lane>
</incident>
<city>TO</city>
<sector>SW</sector>
- <incident>
<active>1</active>
<route>Gardiner</route>
<direction>EB Collect</direction>
<location>approach</location>
<route>Islington</route>
<incident>Collision</incident>
<lane>Right lane</lane>
</incident>
</Tra>
Martin Honnen
2006-05-16 17:55:41 UTC
Permalink
Post by malhenry
Please note I am using VS C++ 6.0 and NOT .NET.
I am getting zero for my count of nodes in the list returned by selectNodes.
It looks like I need to call setProperty(SelectionLanguage,"XPath") first,
but in my code below, setProperty is NOT a valid method for the pDoc object.
Actually, with MSXML 4 the SelectionLanguage is XPath by default and no
other language is supported.

Are you sure you are using MSXML 4?
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
malhenry
2006-05-16 18:03:02 UTC
Permalink
Not sure how I would verify this other than the fact that I installed MSXML
4.0 SP2.
Post by Martin Honnen
Post by malhenry
Please note I am using VS C++ 6.0 and NOT .NET.
I am getting zero for my count of nodes in the list returned by selectNodes.
It looks like I need to call setProperty(SelectionLanguage,"XPath") first,
but in my code below, setProperty is NOT a valid method for the pDoc object.
Actually, with MSXML 4 the SelectionLanguage is XPath by default and no
other language is supported.
Are you sure you are using MSXML 4?
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
malhenry
2006-05-16 18:47:01 UTC
Permalink
OK, it appears you are right I can successfully enter an xpath query without
setting the SelectionLanguage.
However, this query does not work.
BSTR bstrQuery = ::SysAllocString(
L"//TrafficWise/incident[preceding-sibling::city[1]='TO']incident='Collision'" );

hr = pTrafficStatisticsNode->selectNodes(bstrQuery, &pXMLChildNodeList);

Do you know what is wrong with bstrQuery? The xml file was in a previous
post.

Thanks.
Post by Martin Honnen
Post by malhenry
Please note I am using VS C++ 6.0 and NOT .NET.
I am getting zero for my count of nodes in the list returned by selectNodes.
It looks like I need to call setProperty(SelectionLanguage,"XPath") first,
but in my code below, setProperty is NOT a valid method for the pDoc object.
Actually, with MSXML 4 the SelectionLanguage is XPath by default and no
other language is supported.
Are you sure you are using MSXML 4?
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Joe Fawcett
2006-05-17 11:14:39 UTC
Permalink
Post by malhenry
OK, it appears you are right I can successfully enter an xpath query without
setting the SelectionLanguage.
However, this query does not work.
BSTR bstrQuery = ::SysAllocString(
L"//TrafficWise/incident[preceding-sibling::city[1]='TO']incident='Collision'" );
hr = pTrafficStatisticsNode->selectNodes(bstrQuery, &pXMLChildNodeList);
Do you know what is wrong with bstrQuery? The xml file was in a previous
post.
Thanks.
You don't have TrafficWise element, try XPath of:

Tra/incident[preceding-sibling::city[1]= 'TO' and incident = 'Collision']

If that's not what you need let us know the exact specification.
--
Joe Fawcett (MVP - XML)

https://mvp.support.microsoft.com/profile=8AA9D5F5-E1C2-44C7-BCE8-8741D22D17A5
malhenry
2006-05-17 14:23:02 UTC
Permalink
Your suggestion did not work. The problem seems to be with preceding sibling.
I will show you a few examples that work,
some that don't
and include the xml file.

// the following query works to choose specific incidents
// BSTR bstrQuery = ::SysAllocString(
L"//Tra/incident[incident='Construction']" );

// the next query works also
// BSTR bstrQuery = ::SysAllocString(
L"//Tra/incident[incident='Construction' and active='0']" );

// the next two queries fail with hr = -2147467259

//BSTR bstrQuery = ::SysAllocString(
L"/Tra/incident[preceding-sibling::city[1]= 'TO']" );

//BSTR bstrQuery = ::SysAllocString(
L"//Tra/incident[preceding-sibling::city[1]= 'TO']" );

hr = pTrafficStatisticsNode->selectNodes(bstrQuery, &pXMLChildNodeList);

Here is the xml file:

<?xml version="1.0" encoding="ISO-8859-1" ?>
- <Tra>
<date>06-05-16</date>
<time>13:44:31</time>
<city>TO</city>
<sector>CC</sector>
- <incident>
<active>1</active>
<route>401</route>
<direction>WB Express</direction>
<location>between</location>
<route>Jane</route>
<incident>Construction</incident>
<lane>Right lane</lane>
</incident>
<city>TO</city>
<sector>CE</sector>
- <incident>
<active>1</active>
<route>Gerrard</route>
<direction>Both ways</direction>
<location>east of</location>
<route>Coxwell</route>
<incident>Construction</incident>
<lane>Right lane</lane>
</incident>
<city>TO</city>
<sector>CC</sector>
- <incident>
<active>1</active>
<route>Sheppard</route>
<direction />
<location>east of</location>
<route>Bathurst</route>
<incident>Closed repairs</incident>
<lane>All Lanes</lane>
</incident>
<city>TO</city>
<sector>NW</sector>
- <incident>
<active>1</active>
<route>7</route>
<direction />
<location>at</location>
<route>Jane</route>
<incident>Closed repairs</incident>
<lane>All Lanes</lane>
</incident>
<city>TO</city>
<sector />
- <incident>
<active>1</active>
<route>Dufferin</route>
<direction />
<location>at</location>
<route>Lakeshore</route>
<incident>Broken watermain</incident>
<lane />
</incident>
</Tra>

The purpose of my query is to get all incident(outer) nodes whose sibling
node city is from a specific city (ie. TO). I am using msxml 4.0 with C++.
I am NOT using .net.
Thanks for your help!
Post by Joe Fawcett
Post by malhenry
OK, it appears you are right I can successfully enter an xpath query without
setting the SelectionLanguage.
However, this query does not work.
BSTR bstrQuery = ::SysAllocString(
L"//TrafficWise/incident[preceding-sibling::city[1]='TO']incident='Collision'" );
hr = pTrafficStatisticsNode->selectNodes(bstrQuery, &pXMLChildNodeList);
Do you know what is wrong with bstrQuery? The xml file was in a previous
post.
Thanks.
Tra/incident[preceding-sibling::city[1]= 'TO' and incident = 'Collision']
If that's not what you need let us know the exact specification.
--
Joe Fawcett (MVP - XML)
https://mvp.support.microsoft.com/profile=8AA9D5F5-E1C2-44C7-BCE8-8741D22D17A5
Martin Honnen
2006-05-17 15:02:06 UTC
Permalink
Post by malhenry
// the next two queries fail with hr = -2147467259
//BSTR bstrQuery = ::SysAllocString(
L"/Tra/incident[preceding-sibling::city[1]= 'TO']" );
Are you sure it is really MSXML 4 that your C++ code uses? There is
nothing wrong with that XPath expression and I don't have any problems
using with with MSXML 4 and JScript.
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
malhenry
2006-05-17 15:42:02 UTC
Permalink
Can you please tell me a way that I can verify the version of msxml that I am
using? I am new to this and all I know is that I installed MSXML4.0 SP2. I
have not explicitly installed any other versions (to my knowledge).

Thanks.
Post by Martin Honnen
Post by malhenry
// the next two queries fail with hr = -2147467259
//BSTR bstrQuery = ::SysAllocString(
L"/Tra/incident[preceding-sibling::city[1]= 'TO']" );
Are you sure it is really MSXML 4 that your C++ code uses? There is
nothing wrong with that XPath expression and I don't have any problems
using with with MSXML 4 and JScript.
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Joe Fawcett
2006-05-19 11:11:29 UTC
Permalink
Just because you installed msxml 4 doesn't mean your code will use it, you
need to specify the correct uuid and #import msxml4.dll in your code.
Something like:

#import <msxml4.dll>
IXMLDOMDocument3Ptr pXMLDoc;
hr = pXMLDoc.CreateInstance(__uuidof(DOMDocument40));

(Maybe wrong, I can barely read C++)
--
Joe Fawcett - XML MVP


http://joe.fawcett.name
Post by malhenry
Can you please tell me a way that I can verify the version of msxml that I am
using? I am new to this and all I know is that I installed MSXML4.0 SP2.
I
have not explicitly installed any other versions (to my knowledge).
Thanks.
Post by Martin Honnen
Post by malhenry
// the next two queries fail with hr = -2147467259
//BSTR bstrQuery = ::SysAllocString(
L"/Tra/incident[preceding-sibling::city[1]= 'TO']" );
Are you sure it is really MSXML 4 that your C++ code uses? There is
nothing wrong with that XPath expression and I don't have any problems
using with with MSXML 4 and JScript.
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
malhenry
2006-05-19 15:22:02 UTC
Permalink
OK. Here is a statement from stdafx.h:
#import "msxml.dll" named_guids raw_interfaces_only

Does this mean that even though I have msxml4 SP2 installed, that I am
really using version 1.0 ?

Also, here is my constructor code:

HRESULT hr = S_OK;

m_pDoc = NULL; // points to the xml file
m_pBURL = NULL; // name of xml file

// Initialize the COM library on the current thread and identify the
concurrency
// model as single-thread apartment (STA)

::CoInitialize(NULL);

hr = ::CoCreateInstance(MSXML::CLSID_DOMDocument, NULL, CLSCTX_INPROC_SERVER,
MSXML::IID_IXMLDOMDocument, (void**)&m_pDoc);

if (FAILED(hr))
TRACE(TEXT("Failed to Create XML DOM Control (Error:0x%X)"), hr);

And here is stdafx.h:

/ stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//

#if !defined(AFX_STDAFX_H__BFC9D0E5_5242_4676_8A97_5A5D6C573F9C__INCLUDED_)
#define AFX_STDAFX_H__BFC9D0E5_5242_4676_8A97_5A5D6C573F9C__INCLUDED_

// all of the lines below (except the last) were copied from stdafx.h in the
SportsNBA project
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

// Insert your headers here
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions

#ifndef _AFX_NO_OLE_SUPPORT
#include <afxole.h> // MFC OLE classes
#include <afxodlgs.h> // MFC OLE dialog classes
#include <afxdisp.h> // MFC Automation classes
#endif // _AFX_NO_OLE_SUPPORT

#ifndef _AFX_NO_DB_SUPPORT
#include <afxdb.h> // MFC ODBC database classes
#endif // _AFX_NO_DB_SUPPORT

// commented out below because this h file included dbdaoint.h which has
enum definitions
// that conflict with msado15.tlh.
//#ifndef _AFX_NO_DAO_SUPPORT
//#include <afxdao.h> // MFC DAO database classes
//#endif // _AFX_NO_DAO_SUPPORT

#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT

// Disable C++ Warnings about Base Class
#pragma warning(disable: 4275)
#pragma warning(disable: 4251)

/*************************************************************************\
* CRT SUPPORT *
\*************************************************************************/

/* Force strict type checking */
//#define STRICT

/* Solve the Unicode Problem */
#ifdef _UNICODE
#ifndef UNICODE
#define UNICODE /* UNICODE is used by Windows headers */
#endif
#endif

#ifdef UNICODE
#ifndef _UNICODE
#define _UNICODE /* _UNICODE is used by C-runtime/MFC headers */
#endif
#endif

#include <crtdbg.h> // C runtime library Debug Support
#include <stdlib.h> // Standard C runtime library Support
#include <stdio.h> // C runtime library I/O Support
#include <conio.h> // C-Runtime Console Functions

/*************************************************************************\
* WINDOWS SUPPORT *
\*************************************************************************/

/* Disable rarely-used sections of Windows */
#define WIN32_LEAN_AND_MEAN
#define NOMCX
#define NOIME
#define NOSOUND
#define NOCOMM
#define NOKANJI
#define NORPC
#define NOPROXYSTUB
#define NOIMAGE
#define NOTAPE

/* Windows NT Build version 4.0 and above */
#define _WIN32_WINNT 0x0400

//#include <windows.h> // Master include file for Windows applications
#include <tchar.h> // Generic Text Support

//#include "debug.h" // Generic Debug Support, must add Debug.CPP

/*************************************************************************\
* STL SUPPORT *
\*************************************************************************/

#include <string> // String Functions Used in STL
#include <iostream> // Stream Functions Used in STL
#include <stdexcept> // SEH Functions Used in STL

using namespace std; // Required in Version 5.0 Visual C for STL

// Define Generic Text String
typedef basic_string<TCHAR, char_traits<TCHAR>,
allocator<TCHAR> > tstring;

// Remap Standard I/O to Generic Text Functions
#ifdef _UNICODE
#define tcin cin
#define tcout wcout
#define tcerr wcerr
#else
#define tcin cin
#define tcout cout
#define tcerr cerr
#endif

/*************************************************************************\
* COM SUPPORT *
\*************************************************************************/

// Microsoft DOM Control Support
#import "msxml.dll" named_guids raw_interfaces_only

#endif //
!defined(AFX_STDAFX_H__BFC9D0E5_5242_4676_8A97_5A5D6C573F9C__INCLUDED_)


THANKS
Post by Joe Fawcett
Just because you installed msxml 4 doesn't mean your code will use it, you
need to specify the correct uuid and #import msxml4.dll in your code.
#import <msxml4.dll>
IXMLDOMDocument3Ptr pXMLDoc;
hr = pXMLDoc.CreateInstance(__uuidof(DOMDocument40));
(Maybe wrong, I can barely read C++)
--
Joe Fawcett - XML MVP
http://joe.fawcett.name
Post by malhenry
Can you please tell me a way that I can verify the version of msxml that I am
using? I am new to this and all I know is that I installed MSXML4.0 SP2.
I
have not explicitly installed any other versions (to my knowledge).
Thanks.
Post by Martin Honnen
Post by malhenry
// the next two queries fail with hr = -2147467259
//BSTR bstrQuery = ::SysAllocString(
L"/Tra/incident[preceding-sibling::city[1]= 'TO']" );
Are you sure it is really MSXML 4 that your C++ code uses? There is
nothing wrong with that XPath expression and I don't have any problems
using with with MSXML 4 and JScript.
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Joe Fawcett
2006-05-19 22:17:04 UTC
Permalink
As I said C++ is mostly a mystery to me but with other languages if you
don't specify version 4 then you'll never get it, version 3.0 is the best
you can hope for.
You must specify the versions as in my previous post.
If you want to test check the value of getProperty("SelectionLanguage")
after creating the domdocument, with version 4.0 it will be XPath, with
version 3.0 it will be XSLPattern.
--
Joe Fawcett - XML MVP


http://joe.fawcett.name
Post by malhenry
#import "msxml.dll" named_guids raw_interfaces_only
Does this mean that even though I have msxml4 SP2 installed, that I am
really using version 1.0 ?
HRESULT hr = S_OK;
m_pDoc = NULL; // points to the xml file
m_pBURL = NULL; // name of xml file
// Initialize the COM library on the current thread and identify the
concurrency
// model as single-thread apartment (STA)
::CoInitialize(NULL);
hr = ::CoCreateInstance(MSXML::CLSID_DOMDocument, NULL,
CLSCTX_INPROC_SERVER,
MSXML::IID_IXMLDOMDocument, (void**)&m_pDoc);
if (FAILED(hr))
TRACE(TEXT("Failed to Create XML DOM Control (Error:0x%X)"), hr);
/ stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#if
!defined(AFX_STDAFX_H__BFC9D0E5_5242_4676_8A97_5A5D6C573F9C__INCLUDED_)
#define AFX_STDAFX_H__BFC9D0E5_5242_4676_8A97_5A5D6C573F9C__INCLUDED_
// all of the lines below (except the last) were copied from stdafx.h in the
SportsNBA project
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// Insert your headers here
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#ifndef _AFX_NO_OLE_SUPPORT
#include <afxole.h> // MFC OLE classes
#include <afxodlgs.h> // MFC OLE dialog classes
#include <afxdisp.h> // MFC Automation classes
#endif // _AFX_NO_OLE_SUPPORT
#ifndef _AFX_NO_DB_SUPPORT
#include <afxdb.h> // MFC ODBC database classes
#endif // _AFX_NO_DB_SUPPORT
// commented out below because this h file included dbdaoint.h which has
enum definitions
// that conflict with msado15.tlh.
//#ifndef _AFX_NO_DAO_SUPPORT
//#include <afxdao.h> // MFC DAO database classes
//#endif // _AFX_NO_DAO_SUPPORT
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common
Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
// Disable C++ Warnings about Base Class
#pragma warning(disable: 4275)
#pragma warning(disable: 4251)
/*************************************************************************\
* CRT SUPPORT
*
\*************************************************************************/
/* Force strict type checking */
//#define STRICT
/* Solve the Unicode Problem */
#ifdef _UNICODE
#ifndef UNICODE
#define UNICODE /* UNICODE is used by Windows headers */
#endif
#endif
#ifdef UNICODE
#ifndef _UNICODE
#define _UNICODE /* _UNICODE is used by C-runtime/MFC headers */
#endif
#endif
#include <crtdbg.h> // C runtime library Debug Support
#include <stdlib.h> // Standard C runtime library Support
#include <stdio.h> // C runtime library I/O Support
#include <conio.h> // C-Runtime Console Functions
/*************************************************************************\
* WINDOWS SUPPORT
*
\*************************************************************************/
/* Disable rarely-used sections of Windows */
#define WIN32_LEAN_AND_MEAN
#define NOMCX
#define NOIME
#define NOSOUND
#define NOCOMM
#define NOKANJI
#define NORPC
#define NOPROXYSTUB
#define NOIMAGE
#define NOTAPE
/* Windows NT Build version 4.0 and above */
#define _WIN32_WINNT 0x0400
//#include <windows.h> // Master include file for Windows applications
#include <tchar.h> // Generic Text Support
//#include "debug.h" // Generic Debug Support, must add Debug.CPP
/*************************************************************************\
* STL SUPPORT
*
\*************************************************************************/
#include <string> // String Functions Used in STL
#include <iostream> // Stream Functions Used in STL
#include <stdexcept> // SEH Functions Used in STL
using namespace std; // Required in Version 5.0 Visual C for STL
// Define Generic Text String
typedef basic_string<TCHAR, char_traits<TCHAR>,
allocator<TCHAR> > tstring;
// Remap Standard I/O to Generic Text Functions
#ifdef _UNICODE
#define tcin cin
#define tcout wcout
#define tcerr wcerr
#else
#define tcin cin
#define tcout cout
#define tcerr cerr
#endif
/*************************************************************************\
* COM SUPPORT
*
\*************************************************************************/
// Microsoft DOM Control Support
#import "msxml.dll" named_guids raw_interfaces_only
#endif //
!defined(AFX_STDAFX_H__BFC9D0E5_5242_4676_8A97_5A5D6C573F9C__INCLUDED_)
THANKS
Post by Joe Fawcett
Just because you installed msxml 4 doesn't mean your code will use it, you
need to specify the correct uuid and #import msxml4.dll in your code.
#import <msxml4.dll>
IXMLDOMDocument3Ptr pXMLDoc;
hr = pXMLDoc.CreateInstance(__uuidof(DOMDocument40));
(Maybe wrong, I can barely read C++)
--
Joe Fawcett - XML MVP
http://joe.fawcett.name
Post by malhenry
Can you please tell me a way that I can verify the version of msxml
that I
am
using? I am new to this and all I know is that I installed MSXML4.0 SP2.
I
have not explicitly installed any other versions (to my knowledge).
Thanks.
Post by Martin Honnen
Post by malhenry
// the next two queries fail with hr = -2147467259
//BSTR bstrQuery = ::SysAllocString(
L"/Tra/incident[preceding-sibling::city[1]= 'TO']" );
Are you sure it is really MSXML 4 that your C++ code uses? There is
nothing wrong with that XPath expression and I don't have any problems
using with with MSXML 4 and JScript.
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Loading...