policySet.setAppliesTo(appliesTo);
if (appliesTo != null) {
try {
XPath path = xpathHelper.newXPath();
NamespaceContext nsContext = xpathHelper.getNamespaceContext(appliesTo, reader.getNamespaceContext());
// path.setXPathFunctionResolver(new PolicyXPathFunctionResolver(context));
XPathExpression expression = xpathHelper.compile(path, nsContext, appliesTo);
policySet.setAppliesToXPathExpression(expression);
} catch (XPathExpressionException e) {
ContributionReadException ce = new ContributionReadException(e);
error(monitor, "ContributionReadException", policySet, ce);
//throw ce;
}
}
String attachTo = reader.getAttributeValue(null, ATTACH_TO);
if (attachTo != null) {
try {
XPath path = xpathHelper.newXPath();
NamespaceContext nsContext = xpathHelper.getNamespaceContext(attachTo, reader.getNamespaceContext());
path.setXPathFunctionResolver(new PolicyXPathFunctionResolver(nsContext));
attachTo = PolicyXPathFunction.normalize(attachTo,getSCAPrefix(nsContext));
XPathExpression expression = xpathHelper.compile(path, nsContext, attachTo);
policySet.setAttachTo(attachTo);
policySet.setAttachToXPathExpression(expression);