Modify

Opened 8 months ago

Last modified 8 months ago

#22002 new defect

Presets: XmlParsingException using reference plus list_entry in chunk

Reported by: skyper Owned by: team
Priority: normal Milestone:
Component: Core Version:
Keywords: template_report preset xml exception chunk reference list_entry Cc: Hufkratzer

Description (last modified by skyper)

What steps will reproduce the problem?

  1. Have a preset file including <chunk> with <list_entry /> and another <chunk> with <reference /> to the first plus more <list_entry />
   <chunk id="pitch_sports-hall_sports-centre_stadium">
       <list_entry value="pitch" display_value="Pitch" icon="presets/sport/pitch.svg" />
       <list_entry value="sports_hall" display_value="Sports Hall" icon="presets/sport/sports_hall.svg" />
       <list_entry value="sports_centre" display_value="Sports Center" icon="presets/sport/sports_centre.svg" />
       <list_entry value="stadium" display_value="Stadium" icon="presets/sport/stadium.svg" />
   </chunk>
   <chunk id="pitch_sports-hall_sports-centre_stadium_track">
       <reference ref="pitch_sports-hall_sports-centre_stadium" />
       <list_entry value="track" display_value="Racetrack" icon="presets/sport/track.svg" />
   </chunk>
  1. Load the file

What is the expected result?

No exception about syntax error

What happens instead?

2022-04-05 23:12:52.976 SEVERE: <html>Tagging preset source local default can be loaded but it contains errors. Do you really want to use it?<br><br><table width=600>Error is: org.xml.sax.SAXParseException; lineNumber: 242; columnNumber: 94; cvc-complex-type.2.4.a: Invalid content was found starting with element '{"http://josm.openstreetmap.de/tagging-preset-1.0":list_entry}'. One of '{"http://josm.openstreetmap.de/tagging-preset-1.0":label, "http://josm.openstreetmap.de/tagging-preset-1.0":space, "http://josm.openstreetmap.de/tagging-preset-1.0":link, "http://josm.openstreetmap.de/tagging-preset-1.0":preset_link, "http://josm.openstreetmap.de/tagging-preset-1.0":text, "http://josm.openstreetmap.de/tagging-preset-1.0":combo, "http://josm.openstreetmap.de/tagging-preset-1.0":multiselect, "http://josm.openstreetmap.de/tagging-preset-1.0":checkgroup, "http://josm.openstreetmap.de/tagging-preset-1.0":check, "http://josm.openstreetmap.de/tagging-preset-1.0":item_separator, "http://josm.openstreetmap.de/tagging-preset-1.0":reference, "http://josm.openstreetmap.de/tagging-preset-1.0":key, "http://josm.openstreetmap.de/tagging-preset-1.0":optional, "http://josm.openstreetmap.de/tagging-preset-1.0":roles}' is expected. (at line 242, column 94)</table></html>: org.openstreetmap.josm.tools.XmlParsingException: org.xml.sax.SAXParseException; lineNumber: 242; columnNumber: 94; cvc-complex-type.2.4.a: Invalid content was found starting with element '{"http://josm.openstreetmap.de/tagging-preset-1.0":list_entry}'. One of '{"http://josm.openstreetmap.de/tagging-preset-1.0":label, "http://josm.openstreetmap.de/tagging-preset-1.0":space, "http://josm.openstreetmap.de/tagging-preset-1.0":link, "http://josm.openstreetmap.de/tagging-preset-1.0":preset_link, "http://josm.openstreetmap.de/tagging-preset-1.0":text, "http://josm.openstreetmap.de/tagging-preset-1.0":combo, "http://josm.openstreetmap.de/tagging-preset-1.0":multiselect, "http://josm.openstreetmap.de/tagging-preset-1.0":checkgroup, "http://josm.openstreetmap.de/tagging-preset-1.0":check, "http://josm.openstreetmap.de/tagging-preset-1.0":item_separator, "http://josm.openstreetmap.de/tagging-preset-1.0":reference, "http://josm.openstreetmap.de/tagging-preset-1.0":key, "http://josm.openstreetmap.de/tagging-preset-1.0":optional, "http://josm.openstreetmap.de/tagging-preset-1.0":roles}' is expected. (at line 242, column 94). Cause: org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element '{"http://josm.openstreetmap.de/tagging-preset-1.0":list_entry}'. One of '{"http://josm.openstreetmap.de/tagging-preset-1.0":label, "http://josm.openstreetmap.de/tagging-preset-1.0":space, "http://josm.openstreetmap.de/tagging-preset-1.0":link, "http://josm.openstreetmap.de/tagging-preset-1.0":preset_link, "http://josm.openstreetmap.de/tagging-preset-1.0":text, "http://josm.openstreetmap.de/tagging-preset-1.0":combo, "http://josm.openstreetmap.de/tagging-preset-1.0":multiselect, "http://josm.openstreetmap.de/tagging-preset-1.0":checkgroup, "http://josm.openstreetmap.de/tagging-preset-1.0":check, "http://josm.openstreetmap.de/tagging-preset-1.0":item_separator, "http://josm.openstreetmap.de/tagging-preset-1.0":reference, "http://josm.openstreetmap.de/tagging-preset-1.0":key, "http://josm.openstreetmap.de/tagging-preset-1.0":optional, "http://josm.openstreetmap.de/tagging-preset-1.0":roles}' is expected.
2022-04-05 23:12:52.977 SEVERE: <html>Tagging preset source local default can be loaded but it contains errors. Do you really want to use it?<br><br><table width=600>Error is: org.xml.sax.SAXParseException; lineNumber: 242; columnNumber: 94; cvc-complex-type.2.4.a: Invalid content was found starting with element '{"http://josm.openstreetmap.de/tagging-preset-1.0":list_entry}'. One of '{"http://josm.openstreetmap.de/tagging-preset-1.0":label, "http://josm.openstreetmap.de/tagging-preset-1.0":space, "http://josm.openstreetmap.de/tagging-preset-1.0":link, "http://josm.openstreetmap.de/tagging-preset-1.0":preset_link, "http://josm.openstreetmap.de/tagging-preset-1.0":text, "http://josm.openstreetmap.de/tagging-preset-1.0":combo, "http://josm.openstreetmap.de/tagging-preset-1.0":multiselect, "http://josm.openstreetmap.de/tagging-preset-1.0":checkgroup, "http://josm.openstreetmap.de/tagging-preset-1.0":check, "http://josm.openstreetmap.de/tagging-preset-1.0":item_separator, "http://josm.openstreetmap.de/tagging-preset-1.0":reference, "http://josm.openstreetmap.de/tagging-preset-1.0":key, "http://josm.openstreetmap.de/tagging-preset-1.0":optional, "http://josm.openstreetmap.de/tagging-preset-1.0":roles}' is expected. (at line 242, column 94)</table></html>

Please provide any additional information below. Attach a screenshot if possible.

The preset works as expected, though, and my editor displays no warning with <presets xmlns="http://josm.openstreetmap.de/tagging-preset-1.0"> included.
Replacing the reference in the second chunk with referred context, does not raise the exception.

Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2022-04-04 22:26:00 +0200 (Mon, 04 Apr 2022)
Revision:18427
Build-Date:2022-04-05 01:30:55
URL:https://josm.openstreetmap.de/svn/trunk

Identification: JOSM/1.5 (18427 en) Linux Debian GNU/Linux 11 (bullseye)
Java version: 17.0.2+8-Debian-1deb11u1, Debian, OpenJDK 64-Bit Server VM

Attachments (0)

Change History (2)

comment:1 Changed 8 months ago by skyper

Description: modified (diff)

comment:2 Changed 8 months ago by Hufkratzer

Cc: Hufkratzer added

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain team.
as The resolution will be set.
to The owner will be changed from team to the specified user.
The owner will change to skyper
as duplicate The resolution will be set to duplicate.The specified ticket will be cross-referenced with this ticket
The owner will be changed from team to anonymous.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.