in xpath query using prefix to locate a node

I am trying to using nodeselect to locate a node but the nodename has prefix " CS3000GR:". I recieve an error expected token eof found Name /svg[3]/g[0]/GCS3000-->:-->Modifier[0].
Call xmlDoc.Load(strPath & strFileName)
        If xmlDoc.parseError.errorCode = 0 Then
            xmlDoc.SetProperty "SelectionNamespaces", "xmlns:xsl=''"
            xmlDoc.SetProperty "SelectionLanguage", "XPath"
            rstdata.Filter = "FileName =" & strFileName
            Set objNodeList = xmlDoc.documentElement.childNodes
            Do While Not rstdata.EOF
            If rstdata!Modify = "replace" Then
                If rstdata!Type = "element" Then
                  'Ci = VBA.CInt(VBA.Val(VBA.Right(rstdata!pointer, 1)))
                  'strXML = "[" & Ci & "]"
                  strXML = rstdata!xml_space
                    Set objNode = xmlDoc.documentElement.selectSingleNode(strXML)

Open in new window

Who is Participating?
>>has prefix "CS3000GR:".
If I understand you correctly, the "prefix" you are referring to is actually a namespace. Meaning you have nodes that look similar to (for example):

If so, you need to include the namespace in the "SelectionNamespaces" property:
xmlDoc.SetProperty "SelectionNamespaces", "xmlns:xsl='',xmlns:CS3000GR=''"
elgadaaAuthor Commented:
thanks, yes it works
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.