source: TI12-security/trunk/NDG_XACML/ndg/xacml/parsers/etree/attributevaluereader.py @ 6750

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/NDG_XACML/ndg/xacml/parsers/etree/attributevaluereader.py@6750
Revision 6750, 1.1 KB checked in by pjkersha, 10 years ago (diff)

Parsing functionality near complete for rule1.xml

Line 
1"""NDG XACML ElementTree based reader for AttributeValue type
2
3NERC DataGrid Project
4"""
5__author__ = "P J Kershaw"
6__date__ = "16/03/10"
7__copyright__ = "(C) 2010 Science and Technology Facilities Council"
8__contact__ = "Philip.Kershaw@stfc.ac.uk"
9__license__ = "BSD - see LICENSE file in top-level directory"
10__contact__ = "Philip.Kershaw@stfc.ac.uk"
11__revision__ = "$Id: $"
12from ndg.xacml.core.attributevalue import Expression, AttributeValue
13from ndg.xacml.parsers import XMLParseError
14from ndg.xacml.parsers.etree.expressionreader import ExpressionReader
15
16
17class AttributeValueReader(ExpressionReader):
18    '''ElementTree based XACML Expression type parser
19    '''
20    TYPE = AttributeValue
21   
22    def _parseExtension(self, elem, attributeValue):
23        """Implement abstract method to complete parsing of attribute value"""
24           
25        if elem.text is None:
26            raise XMLParseError('No attribute value element found parsing %r' % 
27                                AttributeValueReader.TYPE.ELEMENT_LOCAL_NAME) 
28             
29        attributeValue.value = elem.text.strip()
30   
Note: See TracBrowser for help on using the repository browser.