A
Alastair Cameron
VB6, MSXML 3.2 installed:
Q1.
I am having a problem selecting nodes with XPATH expressions when an
attribute values contain backslashes (\\) in as part of its value:
For example the following statement fails to find a node (even though one
exists in the XML) if the value of the LDAPServerURL attribute is
\\LocalServer but works if the value is "LocalServer".
Set xmlElement = _
xmlConfigFile.documentElement.selectSingleNode("Facility[@LDAPServerURL='" &
<SomeValue> & "']")
I assumed that anything inside the '' was treated as a literal, but XPATH
looks like it is using the backslashes in a XPATH context.
What do I need to do to get anything insde the '<SomeValue>' treated as a
string literal...?
Q2.
Second question: if my attribute values contains embedded single quote (')
or double quotes ("") how do I handle both circumstances when building XPATH
expressions to retrieve them?
Thanks.
Alastair
Q1.
I am having a problem selecting nodes with XPATH expressions when an
attribute values contain backslashes (\\) in as part of its value:
For example the following statement fails to find a node (even though one
exists in the XML) if the value of the LDAPServerURL attribute is
\\LocalServer but works if the value is "LocalServer".
Set xmlElement = _
xmlConfigFile.documentElement.selectSingleNode("Facility[@LDAPServerURL='" &
<SomeValue> & "']")
I assumed that anything inside the '' was treated as a literal, but XPATH
looks like it is using the backslashes in a XPATH context.
What do I need to do to get anything insde the '<SomeValue>' treated as a
string literal...?
Q2.
Second question: if my attribute values contains embedded single quote (')
or double quotes ("") how do I handle both circumstances when building XPATH
expressions to retrieve them?
Thanks.
Alastair