[OSM-newbies] XSLT question

Andrew Errington a.errington at lancaster.ac.uk
Mon Sep 14 13:37:33 BST 2009


Hi all,

I have a simple (maybe) question.  I have downloaded some OSM map data as
XML.  I want to selectively get the names of amenities, e.g. names of
restaurants.  Unfortunately, all of the tags have the same name.

So far I have a very simple XSLT that will find all nodes (or ways,
because a restaurant could be a node or an area) that have a tag with an
attribute k="amenity" and an attribute v="restaurant".  I can query the
parent node and get its id, but I really want to query the sibling nodes,
find the one that has attribute k="name" and print the value of attribute
v (the name itself).

I have searched Google for a while, but I am new to XSLT and I'm not sure
what I am looking for.

Any pointers would be appreciated (and I realise that this is an XML
question, not strictly an OSM question).

Thanks,

Andrew






More information about the newbies mailing list