Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9245381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:15:18+00:00 2026-06-18T09:15:18+00:00

i have an understanding-problem using Microsoft XML Core Services 6.0 (MSXML) with XPath-expressions. I´ve

  • 0

i have an understanding-problem using Microsoft XML Core Services 6.0 (MSXML) with XPath-expressions.
I´ve broken down the problem to the most simple case. So let´s take the following XML-File:

<?xml version="1.0" encoding="UTF-8"?>
<root>
    <element name="E1A1">
        <subEle value="1a"/>
        <subEle value="1b"/>
        <subEle value="1c"/>
    </element>

    <element name="E2A1">
        <subEle value="2a"/>
        <subEle value="2b"/>
        <subEle value="3b"/>
    </element>

    <element name="E3A1">
        <subEle value="3a"/>
        <subEle value="3b"/>
        <subEle value="3c"/>
    </element>
</root>

I want to get the “value“-attribues per “element”. I will use pseudo-code to describe
my problem and i will focus on the important things, so i will not write how i initialize
the Msxml2.DOMDocument variable etc. .
First, i get all “element“-nodes that have a name-attribute:

oNodeList = oDom.selectNodes("//element[@name]")

The result of the selectNodes-statement is a nodelist, where i access the items node by node
in a for-loop. In this loop, i execute another selectNodes-statement, that gives me (at least i thought so)
the “subEle“s for each “element“:

for i from 1 to oNodeList.length
    oNodeMain = oNodeList.nextNode()    
    oNodeResList = oNodeMain.selectNodes("//subEle")
    msgInfo("n items", oNodeResList.length)
endFor

And here comes the problem: the selectNodes-statement in the loops seems to have ALL “subEle”s
in scope; the messagebox pops up three times, telling me the length of the nodelist is 9.
I would have expected that it pops up 3 times, telling me each time that the nodelist has a length of 3 (because
every “element” has exactly 3 “subEle“s), since i´m doing the selectNodes-statement on “oNodeMain“,
which gets the nextNode in each loop. Maybe i just need to modify XPath-expression in the loop and
don´t use the “//“, because it works then, but i have no idea why.

The program i use for this is Paradox 11 and i use MSXML by OLE.
Is this behaviour “normal”, where is my misunderstanding? Any suggestions on how to achieve what i´m
trying are welcome.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T09:15:19+00:00Added an answer on June 18, 2026 at 9:15 am

    Don’t use an absolute path starting with /, instead use a relative path i.e. oNodeMain.selectNodes("subEle") selects all subEle child elements of oNodeMain and oNodeMain.selectNodes(".//subEle") selects all descendant subEle elements of oNodeMain.

    Your path starting with // searches from the root node (also called document node).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I think I have a problem in understanding the proper way of using MVC.
I have a problem understanding and using the 'vec' keyword. I am reading a
I am started using MongoDB few days ago, and i have problem in understanding
I have a problem understanding why shared_ptr is using atomic cpu instructions... I cant
I have an understanding problem of how the following code works: XMLInputFactory xif =
I have problem understanding what the return fibonacci( number-1 ) + fibonacci( number-2 )
I am new to vba and I have problem understanding the workbooks in vba
I have a problem understanding one style definition in Windows 8 metro apps. When
I seem to have a problem understanding how to conditionally test a boolean value
I think i have a basic problem in understanding the dojo toolkit. Well I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.