source: TI05-delivery/ows_framework/trunk/ows_server/ows_server/templates/wms_service_metadata.kid @ 2486

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI05-delivery/ows_framework/trunk/ows_server/ows_server/templates/wms_service_metadata.kid@2486
Revision 2486, 1.2 KB checked in by spascoe, 12 years ago (diff)

Started building a WMS capabilities facade on top of OWS capabilities.

Line 
1<?xml version="1.0"?>
2<?python
3"""Convert a OWS common 1.1.0 compliant ServiceMetadata XML tree into
4WMS 1.3.0 compliant wms:Service XML.
5
6@param ows_c: A ows:Capabilities XML tree node containing
7    ServiceIdentification and ServiceProvider children.
8"""
9
10# Namespaces
11ows_ns = 'http://www.opengis.net/ows/1.1'
12
13# ElementTree utilities
14def qname(ns, tag):
15    return '{%s}%s' % (ns, tag)
16def path(items):
17    return '/'.join(path)
18?>
19<WMS_Capabilities version="1.3.0"
20                  xmlns="http://www.opengis.net/wms"
21                  xmlns:py="http://purl.org/kid/ns#"
22                  xmlns:xlink="http://www.w3.org/1999/xlink"
23                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
24                  xsi:schemaLocation="http://www.opengis.net/wms http://schemas.opengis.net/wms/1.3.0/capabilities_1_2_0.xsd">
25
26<?python
27# Data extracted from ows_c
28title_e = ows_c.find(path([qname(ows_ns, 'ServiceIdentification'),
29                           qname(ows_ns, 'Title')]))
30abstrat_es = ows_c.findall(path([qname(ows_ns, 'ServiceIdentification'),
31                                 qname(ows_ns, 'Abstract')]))
32?>
33
34  <Service>
35    <Name>WMS</Name>
36    <Title py:if="title_e" py:content="title.text"/>
37    <Abstract py:for="e in abstract_e" py:content="e.text"/>
38  </Service>
39</WMS_Capabilities>
Note: See TracBrowser for help on using the repository browser.