Return various attributes using XPATH


How can I return multiple attributes using the xpath language? For example of this xml:

            <encomenda refidprod="rlg05" estado="enviado" data="13-01-2014"/>
            <encomenda refidprod="hifi02" estado="enviado" data="1-10-2014"/>
            <encomendas refidprod="tv02" estado="entregue" data="29-11-2014"/>

How do I return the values of the parcel attributes, both from the basket and the basket?


asked by anonymous 26.02.2015 / 19:18

1 answer


In the XML example, it would be //utilizador/cesto | //utilizador/cestohist to return any of the two attributes.

Explaining : Each of the //utilizador/cesto and //utilizador/cestohist returns only one attribute, the | operator is used to join the two results.

26.02.2015 / 19:22