Question: I have the XML below and want to select the value of the `name` attribute of element `category`.

I looked [here](https://stackoverflow.com/questions/4440451/how-to-ignore-namespaces-with-xpath) and [here](https://stackoverflow.com/questions/6093352/select-xml-node-by-attribute-name-ignoring-namespace-of-that-attribute) and [here](https://stackoverflow.com/questions/39852979/how-to-ignore-namespaces-in-xpath-1-0).

I actually want xpath 1.0, so I tried:  

`/result/products/product/*:[local-name() = 'categories']/*:[local-name() = 'category']/@name` 

Since that didn't work I also just attempted xpath 2.0:  

`/result/products/product/*:categories/*:category/@name`

If I remove the namespace prefixes from the source document, the selector `/result/products/product/categories/category/@name` returns the correct value.

So, how can I ignore namespaces in my selectors?

```
<result version="3.0"
    xmlns="urn:com:tradedoubler:pf:model:xml:output"
    xmlns:ns2="urn:com:tradedoubler:pf:model:xml:common">
    <products>
        <product>
            <ns2:name>MY name</ns2:name>
            <ns2:productImage>https://www.google.com/assets/1400x1960/1519833875/18053428-6dv7qPqW.jpg</ns2:productImage>
            <ns2:categories>
                <ns2:category name="Living&gt;Curtains&gt;Curtains"></ns2:category>
            </ns2:categories>

        </product>
    </products>
</result>

```

Answer: 
Your XPath expression is wrong: you have superfluous `:` in your expression and you also need to take the default namespace `xmlns="urn:com:tradedoubler:pf:model:xml:output"` into account which affects all children of the `<result>` element. 

So use the following expression:

```
/*[local-name() = 'result']/*[local-name() = 'products']/*[local-name() = 'product']/*[local-name() = 'categories']/*[local-name() = 'category']/@name

```
`[code]/*:result/*:products/*:product/*:categories/*:category/@name[/code]`