only get plos firewall rules if plos namespace is present
authorTony Mack <tmack@paris.CS.Princeton.EDU>
Thu, 12 Apr 2012 01:44:56 +0000 (21:44 -0400)
committerTony Mack <tmack@paris.CS.Princeton.EDU>
Thu, 12 Apr 2012 01:44:56 +0000 (21:44 -0400)
sfa/rspecs/elements/versions/plosv1FWRule.py

index e9ea65b..974fc3d 100644 (file)
@@ -16,8 +16,9 @@ class PLOSv1FWRule:
     @staticmethod
     def get_rules(xml):
         rules = []
-        #for rule_elem in xml.xpath('./plos:fw_rule | ./fw_rule'):
-        #    rule = FWRule(rule_elem.attrib, rule_elem)
-        #    rules.append(rule)  
+        if 'plos' in xml.namespaces: 
+            for rule_elem in xml.xpath('./plos:fw_rule | ./fw_rule'):
+                rule = FWRule(rule_elem.attrib, rule_elem)
+                rules.append(rule)  
         return rules