Ignore:
Timestamp:
19/03/10 10:39:33 (11 years ago)
Author:
pjkersha
Message:

Added parsing for Resource type and also a reader factory to return the reader class for a given XACML type.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI12-security/trunk/NDG_XACML/ndg/xacml/parsers/etree/expressionreader.py

    r6750 r6752  
    2727        elem = super(ExpressionReader, self)._parse(obj) 
    2828         
    29         cls = self.__class__.TYPE 
    30         expression = cls() 
     29        xacmlType = self.__class__.TYPE 
     30        expression = xacmlType() 
    3131         
    3232        localName = QName.getLocalPart(elem.tag) 
    33         if localName != cls.ELEMENT_LOCAL_NAME: 
     33        if localName != xacmlType.ELEMENT_LOCAL_NAME: 
    3434            raise XMLParseError("No \"%s\" element found" %  
    35                                 cls.ELEMENT_LOCAL_NAME) 
     35                                xacmlType.ELEMENT_LOCAL_NAME) 
    3636             
    3737        # Unpack *required* attributes from top-level element 
    3838        attributeValues = [] 
    39         for attributeName in (cls.DATA_TYPE_ATTRIB_NAME,): 
     39        for attributeName in (xacmlType.DATA_TYPE_ATTRIB_NAME,): 
    4040            attributeValue = elem.attrib.get(attributeName) 
    4141            if attributeValue is None: 
    4242                raise XMLParseError('No "%s" attribute found in "%s" element' % 
    43                                     (attributeName, cls.ELEMENT_LOCAL_NAME)) 
     43                                    (attributeName, xacmlType.ELEMENT_LOCAL_NAME)) 
    4444                 
    4545            attributeValues.append(attributeValue) 
Note: See TracChangeset for help on using the changeset viewer.