1

<item> <g:id>NS60</g:id> <g:title>Disc Lock</g:title>' </item> How do I get the id and title value on this example since it got a colon? I'm doing this on Google Sheet using the 'importxml' function.

I've tried '//title/@g:id' to no avail.

Ron
  • 11
  • 1
  • Can you provide the sample URL for testing your XML data? – Tanaike Dec 14 '22 at 04:55
  • A quick search for XPath and colon found 1950 answers; it's not just a duplicate, it's the most common XPath question there is. Sorry that the amount of information available is bewildering. – Michael Kay Dec 14 '22 at 11:44
  • @MichaelKay: I've changed the duplicate link to one of your past answers to [Xpath implementation in Google Sheets](https://stackoverflow.com/questions/50128799/xpath-implementation-in-google-sheets), which is particular to [google-sheets]. (`IMPORTXML()` unfortunately does not have an XML namespace prefix binding mechanism.) I've also updated my canonical answer to [How does XPath deal with XML namespaces?](https://stackoverflow.com/q/40796231/290085) for Google Docs' `IMPORTXML()`. – kjhughes Dec 14 '22 at 15:06
  • Thanks for the comments guys. I've tried "//item/*[local-name()='price']" and it worked for me. – Ron Dec 18 '22 at 23:30

0 Answers0