Import an XML with a colon (:) in the xpath


I'm trying to import an XML into a Google spreadsheet with importXML .

I can extract all the fields as:

=importXML( URL, "//item/loquequiero")

But with the fields that start with g: I get an error and I do not understand why.

How can I solve it?

<rss xmlns:g="" version="2.0">
    <title>Whirlpool Argentina</title>
            <![CDATA[ 107 ]]>
                Aire Acondicionado Whirlpool - 3000 FC - Frio/Calor - Blanco
            <![CDATA[ (WB230AB) ]]>
            <![CDATA[ Electrodomésticos - Aires Acondicionados ]]>
            <![CDATA[ Whirlpool ]]>
            <![CDATA[ WB230ANACJ ]]>
            <![CDATA[ WB230ANACJ ]]>
            <![CDATA[ 10.949,25 ]]>
                <![CDATA[ 1 ]]>
                <![CDATA[ 10,949.25 ARS ]]>
        <g:availability>in stock</availability>
asked by César Requena 09.03.2017 в 17:53

1 answer


In the source code of the displayed XML file g: is used as a prefix to indicate that the name of the node corresponds to a namespace, which is specified as the line:

<rss xmlns:g="" version="2.0">

One way to specify the node is to use [nombre()='loquequiero'] .


Assume that A1 has the URL of the XML file, and A2 has the name of the node that interests us (without the prefix g: , we gave loquequiero .) A formula to get all the nodes g:loquequiero is the following :



My answer in English at How to Import XML table Google Sheets

answered by 12.03.2017 в 05:12