source: cows/trunk/cows/xml/__init__.py @ 4008

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/cows/trunk/cows/xml/__init__.py@4008
Revision 4008, 1.0 KB checked in by spascoe, 11 years ago (diff)

New COWS distribution. See [4005] for description.

Line 
1# Copyright (C) 2007 STFC & NERC (Science and Technology Facilities Council).
2# This software may be distributed under the terms of the
3# Q Public License, version 1.0 or later.
4# http://ndg.nerc.ac.uk/public_docs/QPublic_license.txt
5"""
6Reads XML fragments and creates cows objects.
7
8This package is written in a functional rather than object orientated
9style.  Each function expects an ElementTree node as it's first
10argument and returns an cows object.
11
12@author: Stephen Pascoe
13"""
14
15from cows.xml.service_identification import *
16from cows.xml.service_provider import *
17from cows.xml import ns
18from cows.xml.util import *
19from cows.model import ServiceMetadata
20
21def service_metadata(node):
22    sm = ServiceMetadata(
23           serviceIdentification=find_with(node, './{%s}ServiceIdentification'
24                                           % ns.ows, service_identification),
25           serviceProvider=find_with(node, './{%s}ServiceProvider' % ns.ows,
26                                     service_provider)
27           )
28    return sm
29       
Note: See TracBrowser for help on using the repository browser.