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

Below is a JOSM preset I'm developing that generates an error. I'm new to XML and cannot see the error and wonder if anyone else can. JOSM reports the following error when I try to add the code as a Custom Preset in JOSM v. 7182.

Error is [1:1]
Content is not allowed in prolog.

(note: I replaced all "<" with "{" and all ">" with "}" so the code below will display properly)

{presets xmlns=""}
{item name="Tennis court" type="way,closedway"}
{label text="Tagging a tennis court" /}
{key key="leisure" value="pitch" /}
{key key="sport" value="tennis" /}
{check key="fee" text="Fee: " default="off" delete_if_empty="true" /}
{check key="lit" text="Lit: " default="off" delete_if_empty="true" /}
{check key="access" text="Access (yes)" default="on" delete_if_empty="true" /}
{check key="name" text="Name Here " default=" " delete_if_empty="true" /}
{key key="source" value="Bing" /}
{key key="source:name" value="Internet" /}
{key key="surface" value="asphalt" /}

Thanks very much...

asked 03 Jun '14, 22:01

AlaskaDave's gravatar image

accept rate: 16%

Note enclosing code in back ticks will stop it from being interpreted as HTML.

(04 Jun '14, 08:40) SimonPoole ♦

The problem is that you have

check key="name" text="Name Here " default=" " delete_if_empty="true"

you probably meant to have key here. Check is a checkbox. That cannot have an empty default. replace check with key and it work (at least for me)

permanent link

answered 04 Jun '14, 16:48

escada's gravatar image

accept rate: 21%

You are quite right escada. I changed that line to
key key="name" text="Name Here " default=" " delete_if_empty="true"
however, it still produces the same error. You said you loaded it and it worked for you. Would you please post your exact version here?

(04 Jun '14, 17:44) AlaskaDave

Sorry, my bad, it has to be "text key="name" text="Name Here " default=" " delete_if_empty="true"

(04 Jun '14, 20:36) escada

No, that's not it either. Still the same error. Wouldn't it be nice if such error messages would be more explanatory. The days of computers with limited space for text storage are long gone. Y2K is 14 years behind us!

(04 Jun '14, 23:26) AlaskaDave

Is there any character before the first "<" ? A white space, a blank line ? "Content not allowed in prolog" means there is content, aka characters before the first accepted character, which has to be a "<

I'm stil struggling to get the content of the file that is working back to you. Is this dropbox link working for you

(05 Jun '14, 04:21) escada

Finally! Got it. Yes, there was some spurious data in front of the leading "<". Where it came from is beyond me. I only found it by comparing your XML file and mine with ExamDiff, an old friend of mine.

Thanks so much for your help escada.

(05 Jun '14, 06:47) AlaskaDave

you're welcome. Glad I could help

(05 Jun '14, 08:03) escada
showing 5 of 6 show 1 more comments

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: 03 Jun '14, 22:01

question was seen: 3,274 times

last updated: 05 Jun '14, 08:03

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