Extract the node number (XML)

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
JemyM
Posts: 44
Joined: 04 Jul 2017, 11:57

Extract the node number (XML)

30 May 2018, 02:59

Hiyas!

I have been working on a script that do things with a XML file. Specifically a LaunchBox platform file. I have a little script that opens up information about a specific game. Each game is presented within <Game></Game> and I know that I can use something like the following to open the 10th game.

Code: Select all

CurrentNode := launchboxxml.selectSingleNode("//Game[10]/Title/text()")
One thing I wish to do is to be able to click a button to jump to the "next game". Naturally I can just flip to game 11, then game 12 etc the same way. Simple.

But sometimes I call the game by information, like the title or ID numbers etc, such as:

Code: Select all

CurrentNode := launchboxxml.selectSingleNode("//Game/Title[text()='Home Alone']")
In these cases I do not know the number of the node. I have a workaround that allows me to go to the next sibling anyway but its convoluted and it feels unreliable. Is there any other option I may use to identify which node in the series I currently have/had open?
JemyM
Posts: 44
Joined: 04 Jul 2017, 11:57

Re: Extract the node number (XML)

30 May 2018, 17:04

So the goal is to be able to know the number of a specific node. Like knowing what number the node for "Home Alone" is for example.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 222 guests