Changeset 11968 in josm
- Timestamp:
- 2017-04-21T23:30:12+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/scripts/SyncEditorLayerIndex.groovy
r11967 r11968 197 197 myprintln "*** Loaded ${eliEntries.size()} entries (ELI). ***" 198 198 } 199 String cdata(def s) { 200 if(s =~ /[<>&]/) 201 return "<![CDATA[$s]]>" 202 return s 203 } 199 204 200 205 String maininfo(def entry, String offset) { 201 206 String res = offset + "<type>${getType(entry)}</type>\n" 202 res += offset + "<url> <![CDATA[${getUrl(entry)}]]></url>\n"207 res += offset + "<url>${cdata(getUrl(entry))}</url>\n" 203 208 if(getType(entry) == "tms") { 204 209 if(getMinZoom(entry) != null) … … 209 214 return res 210 215 } 211 212 216 213 217 void printentries(def entries, def stream) { … … 221 225 stream.write " <name>${getName(e)}</name>\n" 222 226 stream.write " <id>${getId(e)}</id>\n" 223 if(getDate(e) != "") 224 stream.write " <date>${getDate(e)}</date>\n" 227 def t 228 if((t = getDate(e))) 229 stream.write " <date>$t</date>\n" 230 if((t = getCountryCode(e))) 231 stream.write " <country-code>$t</country-code>\n" 232 if((t = getIcon(e))) 233 stream.write " <icon>${cdata(t)}</icon>\n" 225 234 stream.write maininfo(e, " ") 226 235 for (def m : getMirrors(e)) {
Note:
See TracChangeset
for help on using the changeset viewer.