use of org.eclipse.wst.xsl.core.model.Stylesheet in project webtools.sourceediting by eclipse.
the class XSLValidator method calculateProblems.
private void calculateProblems(StylesheetModel stylesheetComposed, XSLValidationReport report) throws MaxErrorsExceededException {
// circular reference check
checkCircularRef(stylesheetComposed, report);
// include checks
checkIncludesImports(stylesheetComposed, report);
// template checks
checkTemplates(stylesheetComposed, report);
Stylesheet stylesheet = stylesheetComposed.getStylesheet();
if (XSLT2_Version.equals(stylesheet.getVersion())) {
checkFunctions(stylesheetComposed, report);
}
// call-template checks
checkCallTemplates(stylesheetComposed, report);
// call-template checks
if (getPreference(ValidationPreferences.XPATHS) > IMarker.SEVERITY_INFO)
checkXPaths(stylesheetComposed.getStylesheet(), report);
// TODO a) check globals and b) apply-templates where mode does not
// exist
}
use of org.eclipse.wst.xsl.core.model.Stylesheet in project webtools.sourceediting by eclipse.
the class TestStylesheet method testGetGlobalVariables.
@Test
public void testGetGlobalVariables() {
Stylesheet stylesheet = builder.getStylesheet(getFile("globalVariablesTest.xsl"), false);
assertNotNull("Model failed to load, returned NULL", stylesheet);
List<Variable> globalVariablesList = stylesheet.getGlobalVariables();
assertEquals("Wrong number of global variables returned.", 3, globalVariablesList.size());
}
use of org.eclipse.wst.xsl.core.model.Stylesheet in project webtools.sourceediting by eclipse.
the class TestStylesheet method testGetVersion.
@Test
public void testGetVersion() {
Stylesheet stylesheet = builder.getStylesheet(getFile("globalVariablesTest.xsl"), false);
assertNotNull("Model failed to load, returned NULL", stylesheet);
// Line Number is off by 1 from what is displayed in the Editor
assertEquals("Wrong version number returned.", "1.0", stylesheet.getVersion());
}
use of org.eclipse.wst.xsl.core.model.Stylesheet in project webtools.sourceediting by eclipse.
the class TestStylesheet method testGetAttributes.
@Test
public void testGetAttributes() {
Stylesheet stylesheet = builder.getStylesheet(getFile("globalVariablesTest.xsl"), false);
assertNotNull("Model failed to load, returned NULL", stylesheet);
Map<String, XSLAttribute> attributeList = stylesheet.getAttributes();
assertEquals("Incorrect number of attributes", 4, attributeList.size());
XSLAttribute attribute = stylesheet.getAttribute("exclude-result-prefixes");
assertEquals("Wrong attribute returned:", "exclude-result-prefixes", attribute.getName());
}
use of org.eclipse.wst.xsl.core.model.Stylesheet in project webtools.sourceediting by eclipse.
the class TestStylesheet method testGetImports.
@Test
public void testGetImports() {
Stylesheet stylesheet = builder.getStylesheet(getFile("style1.xsl"), false);
assertNotNull("Model failed to load, returned NULL", stylesheet);
List<Import> includeList = stylesheet.getImports();
assertEquals("Wrong number of includes returned.", 1, includeList.size());
}
Aggregations