summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatteo TURRA2013-04-10 20:27:50 (EDT)
committerJesper Steen Møller2013-04-10 20:27:50 (EDT)
commit05deb2bd6122d627d7065406aff16c3a0ef0d737 (patch)
tree8d168dc40739d3eea0d565fdc11741d49b2c6942
parente3c0357914b448176c8153564866fc24b8c1654d (diff)
downloadwebtools.sourceediting.xsl-05deb2bd6122d627d7065406aff16c3a0ef0d737.zip
webtools.sourceediting.xsl-05deb2bd6122d627d7065406aff16c3a0ef0d737.tar.gz
webtools.sourceediting.xsl-05deb2bd6122d627d7065406aff16c3a0ef0d737.tar.bz2
[342793] Xsl include/import reference validation doesn't signal error onv201304110129
Unresolved reference.
-rw-r--r--bundles/org.eclipse.wst.xsl.core/src/org/eclipse/wst/xsl/core/internal/validation/XSLValidator.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/bundles/org.eclipse.wst.xsl.core/src/org/eclipse/wst/xsl/core/internal/validation/XSLValidator.java b/bundles/org.eclipse.wst.xsl.core/src/org/eclipse/wst/xsl/core/internal/validation/XSLValidator.java
index c79fba3..a050736 100644
--- a/bundles/org.eclipse.wst.xsl.core/src/org/eclipse/wst/xsl/core/internal/validation/XSLValidator.java
+++ b/bundles/org.eclipse.wst.xsl.core/src/org/eclipse/wst/xsl/core/internal/validation/XSLValidator.java
@@ -232,7 +232,7 @@ public class XSLValidator {
String baseURI = include.getStylesheet().getFile().getLocationURI().toString();
String resolvedURI = URIResolverPlugin.createResolver().resolve(baseURI, "", att.getValue()); //$NON-NLS-1$
- if (resolvedURI == null) {
+ if ((resolvedURI == null) || (!importOrIncludeExists(stylesheetComposed.getStylesheet().getFile(), resolvedURI))) {
createMarker(
report,
att,
@@ -262,7 +262,8 @@ public class XSLValidator {
String baseURI = include.getStylesheet().getFile().getLocationURI().toString();
String resolvedURI = URIResolverPlugin.createResolver().resolve(baseURI, "", att.getValue()); //$NON-NLS-1$
- if (resolvedURI == null) {
+
+ if ((resolvedURI == null) || !(importOrIncludeExists(stylesheetComposed.getStylesheet().getFile(), resolvedURI))) {
createMarker(
report,
att,
@@ -286,6 +287,15 @@ public class XSLValidator {
}
}
+ private boolean importOrIncludeExists(IFile currentStylesheet, String resolvedURI) {
+ if (resolvedURI.startsWith("file:")) {
+ IFile file = XSLCore.resolveFile(currentStylesheet, resolvedURI);
+ return (file!=null);
+ } else {
+ return false;
+ }
+ }
+
private void checkFunctions(StylesheetModel stylesheetComposed, XSLValidationReport report) throws MaxErrorsExceededException {
for (Function function : stylesheetComposed.getStylesheet().getFunctions()) {
if (function.getName() != null) {