Changeset 4331

Show
Ignore:
Timestamp:
03/05/09 11:04:28 (18 months ago)
Author:
hans
Message:

fix namespace url replacement, add correction function for existing data

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • deployed/bos/projects/bos/web/kml-handlers.lisp

    r4330 r4331  
    9090(defun replace-all-url-hosts (string new-host) 
    9191  "Replaces all hostnames in STRING by NEW-HOST." 
    92   (ppcre:regex-replace-all #?r"((?:https?|ftp)://)\w+(?:\.\w+)*(?::\d+)?" string #?r"\1${new-host}")) 
     92  (ppcre:regex-replace-all #?r"(?<!xmlns=[\"'])((?:https?|ftp)://)\w+(?:\.\w+)*(?::\d+)?" string #?r"\1${new-host}")) 
    9393 
    9494(defun replace-lang-query-params (string new-lang) 
     
    268268                                         (with-element "latitude" (text "49.89989439494514")) 
    269269                                         (with-element "altitude" (text "0")) 
    270                                          (with-element "range" (text "5400715.913126094")) 
     270                                         (with-element "heading" (text "0")) 
    271271                                         (with-element "tilt" (text "0")) 
    272                                          (with-element "heading" (text "0")))))))))) 
     272                                         (with-element "range" (text "5400715.913126094")))))))))) 
    273273 
    274274(defmethod handle-object ((handler kml-root-dynamic-handler) (object sponsor)) 
     
    354354      (kml-region (make-rectangle2 (allocation-area-bounding-box2 area)) 
    355355                  nil)))) 
     356 
     357(defun fix-xmlns () 
     358  (with-transaction (:update-kml) 
     359    (dolist (kml-root (class-instances 'kml-root-data)) 
     360      (with-slots (kml-string) kml-root 
     361        (setf kml-string (cl-ppcre:regex-replace-all "http://earth.google.com/kml/2.2" 
     362                                                     kml-string 
     363                                                     "http://www.opengis.net/kml/2.2"))))))