NOTICE: is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum


I want to create a relation for a river. I do a XAPI name tag search and save the XML file in my computer. How do I transform the XML - I need to filter way ids and transform them into XML relation members for input with RawEditor. I have an XSLT stylesheet ready but I have trouble displaying the result in Firefox (shows blank page).

The stylesheet is here:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="">
<xsl:output method="xml" indent="yes"/>

<xsl:template match="/osm">
    <xsl:apply-templates select="way"/>

<xsl:template match="way">
  <member type="way" ref="{@id}"/>


asked 02 Oct '11, 18:49

Kozuch's gravatar image

accept rate: 8%

I wouldn't worry about XML transformations, myself - you're just after filling in the list for the rawedit upload, so that's a bunch of lines like:

<member type="way" ref="1234" role=""/>

I'd create a list of ways that you want to use from the XAPI output and then convert into the required "member" list using an editing macro in your favourite text editor. Obviously you'll then need to check the list of omissions and things that shouldn't be in it manually (have a look at the wiki "browserelation" links).

Then, re-order in the order that you want by following EdLoach's answer to this question.

permanent link

answered 03 Oct '11, 13:08

SomeoneElse's gravatar image

SomeoneElse ♦
accept rate: 16%

I just found an XSL processor called SAXON which works great with the stylesheet. Or is there easier way how to filter the the ways out of a XAPI search result?

(03 Oct '11, 13:43) Kozuch

To filter the ways out of an XAPI search result, I'd use "grep" (or "find matching lines" in editor-of-your-choice) myself, but if SAXON works for you, that's great too.

(03 Oct '11, 14:05) SomeoneElse ♦

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 02 Oct '11, 18:49

question was seen: 4,391 times

last updated: 03 Oct '11, 14:05

NOTICE: is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum