Only save the composite into DOM if there is a policySet with attachTo
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@820166 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
391774bfc9
commit
482eff11e6
1 changed files with 4 additions and 1 deletions
|
@ -118,7 +118,7 @@ public class PolicyAttachmentBuilderImpl implements CompositeBuilder {
|
|||
}
|
||||
}
|
||||
}
|
||||
Document document = saveAsDOM(composite);
|
||||
Document document = null;
|
||||
|
||||
for (PolicySet ps : definitions.getPolicySets()) {
|
||||
// First calculate the applicable nodes
|
||||
|
@ -135,6 +135,9 @@ public class PolicyAttachmentBuilderImpl implements CompositeBuilder {
|
|||
*/
|
||||
XPathExpression exp = ps.getAttachToXPathExpression();
|
||||
if (exp != null) {
|
||||
if (document == null) {
|
||||
document = saveAsDOM(composite);
|
||||
}
|
||||
NodeList nodes = (NodeList)exp.evaluate(document, XPathConstants.NODESET);
|
||||
for (int i = 0; i < nodes.getLength(); i++) {
|
||||
Node node = nodes.item(i);
|
||||
|
|
Loading…
Add table
Reference in a new issue