473,320 Members | 2,041 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Is this a problem with / or . within the data values?

JB
Does anyone know why this code works in example A but not in example B ? Is
this a problem with special characters within the data values?

A) Set xmlNodeList =
xmlParentNode.selectNodes("//PredecessorLink[CrossProjectName='A5']")
B) Set xmlNodeList =
xmlParentNode.selectNodes("//PredecessorLink[CrossProjectName='\\winntpath\mypath\file.mpp\1']")

The data contains both values, but the code can't find the
'\\winntpath\mypath\file.mpp' value...
<PredecessorLink>
<CrossProject>1</CrossProject>
<CrossProjectName>A5</CrossProjectName>
</PredecessorLink>
<PredecessorLink>
<CrossProject>1</CrossProject>
<CrossProjectName>\\winntpath\mypath\file.mpp\1</CrossProjectName>
</PredecessorLink>


Mar 5 '07 #1
1 2176
JB wrote:
B) Set xmlNodeList =
xmlParentNode.selectNodes("//PredecessorLink[CrossProjectName='\\winntpath\mypath\file.mpp\1']")

The data contains both values, but the code can't find the
'\\winntpath\mypath\file.mpp' value...
<PredecessorLink>
<CrossProject>1</CrossProject>
<CrossProjectName>A5</CrossProjectName>
</PredecessorLink>
<PredecessorLink>
<CrossProject>1</CrossProject>
<CrossProjectName>\\winntpath\mypath\file.mpp\1</CrossProjectName>
</PredecessorLink>
Works for me with MSXML 3 if setProperty "SelectionLanguage", "XPath" is
called before the selectNodes call:

Dim XmlDocument, XmlNodeList
Set XmlDocument = CreateObject("Msxml2.DOMDocument.3.0")
If XmlDocument.load("test2007030601.xml") Then
XmlDocument.setProperty "SelectionLanguage", "XPath"
Set XmlNodeList =
XmlDocument.selectNodes("//PredecessorLink[CrossProjectName='\\winntpath\mypath\file.mpp\1']")
WScript.Echo "Found " & XmlNodeList.length & " element(s)."
Else
WScript.Echo xmlDocument.parseError.reason
End If

If you use MSXML 3 and selectSingleNode/selectNodes make sure you call e.g.
XmlDocument.setProperty "SelectionLanguage", "XPath"
once before making any selectSingleNode/selectNodes calls with XPath
expressions.
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Mar 6 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: laurie | last post by:
Hi all, I'm trying to help out a friend who has inherited a client with a PHP shopping cart application. Neither of us know PHP, but I've been muddling my way through, trying to get these old...
7
by: What-a-Tool | last post by:
Have no problem getting my select queries to work using this method: strSQL = "SELECT tblUI.IPAdd FROM tblUI WHERE (tblUI.IPAdd =?)" arSPrm = Array(strRemHst) Set rst = cmd.Execute(,arSPrm)...
21
by: Dan | last post by:
Hi, just ran into my first instance of a backend Access97 database not compacting. I'm getting the "MSACCESS.EXE has generated errors.." message on compact. I've narrowed it down to the largest...
2
by: mrhicks | last post by:
Hello all, I have a question about enumerations. Within some requirements data passed back a certain bit field is defined by three bits then in another section the bit field is defined as 4...
9
by: Jakob Lithner | last post by:
1) I have a DataGridView with edit capability. But in some columns I want to limit the input with a DropDownList. There is no inbuilt column for DropDownLists so I intended to add one myself. I...
5
by: Sam | last post by:
Hi, I have one table like : MyTable {field1, field2, startdate, enddate} I want to have the count of field1 between startdate and enddate, and the count of field2 where field2 = 1 between...
1
by: napolpie | last post by:
----Messaggio originale---- Da: napolpie@tin.it Data: 3-mag-2007 10.02 A: <python-list@python.org> Ogg: problem with meteo datas Hello, I'm Peter and I'm new in python codying and I'm using...
9
by: dli07 | last post by:
Hello, I'm trying to convert a piece of code that creates a dynamic vertical resizing bar in a table from internet explorer to firefox. It's based on a post from...
5
matheussousuke
by: matheussousuke | last post by:
Hello, I'm using tiny MCE plugin on my oscommerce and it is inserting my website URL when I use insert image function in the emails. The goal is: Make it send the email with the URL...
9
by: RichG | last post by:
I'm working with a data stream of 8 bytes in an embedded application. In most cases the data is byte aligned so I can define a structure and then memcpy the data directly to the structure elements. ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.