Modify

Opened 9 years ago

Closed 7 years ago

#5534 closed defect (fixed)

Preset schema was weakened - delete_if_empty for check is no longer boolean

Reported by: AlfonZ Owned by: ce
Priority: normal Milestone:
Component: Internal preset Version:
Keywords: Cc: jttt

Description (last modified by simon04)

Add attached preset-wrongcheck.xml as new tagging presets, click OK.

No error. Should complain cvc-datatype-valid.1.2.1: 'FOOBAR' is not a valid value for 'boolean'. (at line 7, column 79).

Presumably caused by r3582.

Attachments (1)

preset-wrongcheck.xml (673 bytes) - added by AlfonZ 9 years ago.
Preset with deliberate error

Download all attachments as: .zip

Change History (5)

Changed 9 years ago by AlfonZ

Attachment: preset-wrongcheck.xml added

Preset with deliberate error

comment:1 Changed 9 years ago by jttt

I've removed it because it's not supported for Checks (and it looks like it never was, it was an error in original schema file).

Problem with current tagging-preset file format is that it supports attributes like text.de which can't be checked by xsd so for every element are allowed all attributes (except for some common errors that are listed as use="forbidden"). delete_if_empty on check is not listed as forbidden so it's silently ignored.

It would be possible to have two schemas for tagging preset - the current one + new xsd friendly schema that will replace localized attributes with nested elements. So for example

<link href="http://wiki.openstreetmap.org/wiki/Tag:highway=motorway"
  de.href="http://wiki.openstreetmap.org/wiki/DE:Tag:highway=motorway" />

would become

<link href="http://wiki.openstreetmap.org/wiki/Tag:highway=motorway">
  <href lang="de" value="http://wiki.openstreetmap.org/wiki/DE:Tag:highway=motorway"/>
</link>

Not a big deal to implement this, but I'm just not sure it's worth the trouble...

comment:2 Changed 9 years ago by AlfonZ

I was playing a bit with delete_if_empty (in Text/Combo/Check) and found out, that it is completely not used now. What I mean is, try following steps:

  1. create way, apply Highways/Street/Primary - ref=R1, layer=1
  2. on the same way apply Highways/Street/Bridge - clear layer

layer tag remains 1

With JOSM 3514, layer tag will be cleared, and depending on delete_if_empty in preset it will be left empty (delete_if_empty=false) or will be removed (delete_if_empty=true). Behaviour presumably changed by r3518.
Similar steps with Check (e.g. setting bridge in Primary as unset) behave the same, except the bridge tag was always removed because delete_if_empty is not taken into account, as jttt mentioned.

Does this require another ticket?

comment:3 in reply to:  2 Changed 8 years ago by simon04

Replying to AlfonZ:

Does this require another ticket?

See #6364.

comment:4 Changed 7 years ago by simon04

Description: modified (diff)
Resolution: fixed
Status: newclosed

delete_if_empty has been dropped in r5155.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain ce.
as The resolution will be set.
The resolution will be deleted.

Add Comment


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

 
Note: See TracTickets for help on using tickets.