105 |
# Extract fees information |
# Extract fees information |
106 |
foo = getElementByName(getElementByName(root, 'Service'), 'Fees') |
foo = getElementByName(getElementByName(root, 'Service'), 'Fees') |
107 |
if foo and len(foo.childNodes[0].data) \ |
if foo and len(foo.childNodes[0].data) \ |
108 |
and lower(foo.childNodes[0].data) != 'none': |
and foo.childNodes[0].data.lower() != 'none': |
109 |
self.fees = foo.childNodes[0].data |
self.fees = foo.childNodes[0].data |
110 |
|
|
111 |
# Extract access information |
# Extract access information |
112 |
foo = getElementByName(getElementByName(root, 'Service'), |
foo = getElementByName(getElementByName(root, 'Service'), |
113 |
'AccessConstraints') |
'AccessConstraints') |
114 |
if foo and len(foo.childNodes[0].data) \ |
if foo and len(foo.childNodes[0].data) \ |
115 |
and lower(foo.childNodes[0].data) != 'none': |
and foo.childNodes[0].data.lower() != 'none': |
116 |
self.access = foo.childNodes[0].data |
self.access = foo.childNodes[0].data |
117 |
|
|
118 |
# Extract output format information |
# Extract output format information |
482 |
|
|
483 |
import os |
import os |
484 |
|
|
485 |
|
sample = "test/sample.xml" |
486 |
try: |
try: |
487 |
f = open("test/sample.xml", "r") |
f = open(sample, "r") |
488 |
except IOError: |
except IOError: |
489 |
try: |
try: |
490 |
f = open(os.path.dirname(__file__) + "/test/sample.xml", "r") |
f = open(os.path.dirname(__file__) + "/" + sample, "r") |
491 |
except IOError: |
except IOError: |
492 |
print "Cannot open sample.xml for reading" |
print "Cannot open %s for reading" % sample |
493 |
|
|
494 |
if f is not None: |
if f is not None: |
495 |
sample = f.read(); |
sample = f.read(); |