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

1
1

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="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"/>

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

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

</xsl:stylesheet>

asked 02 Oct '11, 18:49

Kozuch's gravatar image

Kozuch
1.7k587285
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 ♦
36.9k71370866
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

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "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:

×236
×84
×32
×24
×5

question asked: 02 Oct '11, 18:49

question was seen: 4,524 times

last updated: 03 Oct '11, 14:05

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