Back when I first wrote one of my programs, I used XML as a data file structure (good) but then used node names like “Pipe1” and “Pipe2” (bad, since it makes it hard to add more PipeX nodes). I’m updating my data file structure and would like to use XQL to get all of the nodes that begin with the text “Pipe” but can’t figure out how to do it. It appears that there’s a function “starts-with” for XQL but I can’t figure out how to use it with Xojo.
It took some research and trial-and-error, but this seems to work:
dim nodes as XMLNodeList = xml.Xql( "//*[starts-with(local-name(),'Pipe')]" )
Kem, you anticipated me for a couple of seconds
I was just waiting for you to finish typing so I could hit “post”.
This isn’t my area of expertise. I guess I got it right?
Awesome, thank you! I didn’t know what to put for “local-name()”.
local-name() is the node name, that’s name(), without the namespace prefix.