Ignore:
Timestamp:
09/06/06 15:57:23 (14 years ago)
Author:
domlowe
Message:

Added CSML security metadata: example.xml contains sample csml security tags (same as MOLES). Parser now parses security elements. CSML Schema has been revised and will be committed separately.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI02-CSML/trunk/parser/parser_extra.py

    r925 r1147  
    4949        csmlstring=csmlstring.replace('{http://www.w3.org/1999/xlink}','xlink:') 
    5050        csmlstring=csmlstring.replace('{http://www.opengis.net/om}','om:')         
     51        csmlstring=csmlstring.replace('{http://ndg.nerc.ac.uk/moles}','moles:') 
    5152        #remove cmsl: prefixes 
    5253        csmlstring=csmlstring.replace('<csml:','<') 
     
    5455         
    5556        #add namespace declarations at top of document 
    56         csmlstring=csmlstring.replace('<Dataset', '<Dataset xmlns="http://ndg.nerc.ac.uk/csml"  xmlns:gml="http://www.opengis.net/gml" xmlns:om="http://www.opengis.net/om" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://ndg.nerc.ac.uk/csml/XMLSchemas/CSMLAppSchema.xsd"') 
     57        csmlstring=csmlstring.replace('<Dataset', '<Dataset xmlns="http://ndg.nerc.ac.uk/csml"  xmlns:gml="http://www.opengis.net/gml" xmlns:om="http://www.opengis.net/om" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:moles="http://ndg.nerc.ac.uk/moles" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://ndg.nerc.ac.uk/csml/XMLSchemas/CSMLAppSchema.xsd"') 
    5758         
    5859        #this is only used when creating a new csml document 
     
    6061        csmlstring=csmlstring.replace('xmlns:ns1', 'xmlns:xlink') 
    6162        csmlstring=csmlstring.replace('ns1:href', 'xlink:href') 
     63        csmlstring=csmlstring.replace('ns1:moles', 'xlink:moles') 
    6264        csmlstring=csmlstring.replace('ns1:', '')  #the rest of the ns1s are CSML namespaces... due to the way it has been parsed.         
    6365        return csmlstring 
Note: See TracChangeset for help on using the changeset viewer.