Posts

xpath get many nodes at once

Image
up vote 0 down vote favorite I'm a newbie to Xpath and can't solve this for a few hours now. I've got an xml response from maps.googleapis.com/maps/api/geocode/xml?latlng=51,0 which contains multiple "results", and each "result" may contain multiple "address_component". Response is parsed in specific prog, and it can't use concatenations like /GeocodeResponse[1]/status[text()='OK'] | /GeocodeResponse[1]/result[1]/type | /GeocodeResponse[1]/result[1]/address_component[1]... and it can be done only through one request like /GeocodeResponse[1]/[self::status[text()='OK'] or self::result[1]/type or self::result[1]/address_component[1]] but this path returns all "results", while I need only the first one and nodes inside it("type", "formatt...