1.1 --- a/bpel.mapper/src/org/netbeans/modules/bpel/mapper/multiview/DesignContextControllerImpl2.java Fri Apr 04 12:11:04 2008 +0400
1.2 +++ b/bpel.mapper/src/org/netbeans/modules/bpel/mapper/multiview/DesignContextControllerImpl2.java Mon Apr 07 17:52:19 2008 +0400
1.3 @@ -543,7 +543,10 @@
1.4
1.5 private void checkXPathExpression(ContentElement contenElement, StringBuffer errMsgBuffer) {
1.6 String xpathExpression = contenElement.getContent();
1.7 - if ((xpathExpression != null) && (xpathExpression.length() > 0)) {
1.8 + if (xpathExpression == null) return;
1.9 +
1.10 + xpathExpression = xpathExpression.trim();
1.11 + if (isCheckingRequired(xpathExpression)) {
1.12 String errMsg = checkXPathExpression(contenElement, xpathExpression);
1.13 if (errMsg != null) {
1.14 errMsgBuffer.append((errMsgBuffer.length() > 0) ?
1.15 @@ -553,6 +556,17 @@
1.16 }
1.17 }
1.18
1.19 + private boolean isCheckingRequired(String xpathExpression) {
1.20 + if ((xpathExpression == null) || (xpathExpression.trim().length() == 0) ||
1.21 + // value of xpathExpression is a literal (for example, 'blah-blah-blah')
1.22 + ((xpathExpression.startsWith("'")) && (xpathExpression.endsWith("'"))) ||
1.23 + // xpathExpression contains a function
1.24 + ((xpathExpression.contains("(")) && (xpathExpression.contains(")")))) {
1.25 + return false;
1.26 + }
1.27 + return true;
1.28 + }
1.29 +
1.30 private String checkXPathExpression(ContentElement contenElement, String xpathExpression) {
1.31 if (Utils.checkXPathExpression(contenElement) == null) {
1.32 String