Repository: incubator-openaz Updated Branches: refs/heads/master 9a39d271e -> 920dda192
Fix loading policy files with leading comments/whitespace etc. Project: http://git-wip-us.apache.org/repos/asf/incubator-openaz/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-openaz/commit/920dda19 Tree: http://git-wip-us.apache.org/repos/asf/incubator-openaz/tree/920dda19 Diff: http://git-wip-us.apache.org/repos/asf/incubator-openaz/diff/920dda19 Branch: refs/heads/master Commit: 920dda192242e42fc0846654f1c70527ca76cf54 Parents: 9a39d27 Author: Colm O hEigeartaigh <[email protected]> Authored: Wed Apr 15 14:12:20 2015 +0100 Committer: Colm O hEigeartaigh <[email protected]> Committed: Wed Apr 15 14:12:20 2015 +0100 ---------------------------------------------------------------------- .../com/att/research/xacmlatt/pdp/policy/dom/DOMPolicyDef.java | 3 +++ 1 file changed, 3 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-openaz/blob/920dda19/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMPolicyDef.java ---------------------------------------------------------------------- diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMPolicyDef.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMPolicyDef.java index d9d9f84..e7ee2c1 100644 --- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMPolicyDef.java +++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMPolicyDef.java @@ -59,6 +59,9 @@ public abstract class DOMPolicyDef { PolicyDef policyDef = null; try { Node rootNode = document.getFirstChild(); + while (rootNode != null && rootNode.getNodeType() != Node.ELEMENT_NODE) { + rootNode = rootNode.getNextSibling(); + } if (rootNode == null) { throw new Exception("No child in document"); }
