Search in sources :

Example 16 with Stylesheet

use of org.eclipse.wst.xsl.core.model.Stylesheet in project webtools.sourceediting by eclipse.

the class TestStylesheet method testLoadModel.

@Test
public void testLoadModel() {
    Stylesheet model = builder.getStylesheet(getFile("style1.xsl"), false);
    assertNotNull("Model failed to load, returned NULL", model);
}
Also used : Stylesheet(org.eclipse.wst.xsl.core.model.Stylesheet) Test(org.junit.Test)

Example 17 with Stylesheet

use of org.eclipse.wst.xsl.core.model.Stylesheet in project webtools.sourceediting by eclipse.

the class TestStylesheet method testXSLT2GetVersion.

@Test
public void testXSLT2GetVersion() {
    Stylesheet stylesheet = builder.getStylesheet(getFile("XSLT20Test.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.", "2.0", stylesheet.getVersion());
}
Also used : Stylesheet(org.eclipse.wst.xsl.core.model.Stylesheet) Test(org.junit.Test)

Example 18 with Stylesheet

use of org.eclipse.wst.xsl.core.model.Stylesheet in project webtools.sourceediting by eclipse.

the class TestStylesheet method testGetFunction.

@Test
public void testGetFunction() {
    Stylesheet stylesheet = builder.getStylesheet(getFile("XSLT20FunctionTest.xsl"), false);
    assertNotNull("Model failed to load, returned NULL", stylesheet);
    List<Function> functionList = stylesheet.getFunctions();
    assertEquals("Wrong number of global variables returned.", 2, functionList.size());
}
Also used : Function(org.eclipse.wst.xsl.core.model.Function) Stylesheet(org.eclipse.wst.xsl.core.model.Stylesheet) Test(org.junit.Test)

Example 19 with Stylesheet

use of org.eclipse.wst.xsl.core.model.Stylesheet in project webtools.sourceediting by eclipse.

the class TestStylesheet method testGetIncludes.

@Test
public void testGetIncludes() {
    Stylesheet stylesheet = builder.getStylesheet(getFile("style1.xsl"), false);
    assertNotNull("Model failed to load, returned NULL", stylesheet);
    List<Include> includeList = stylesheet.getIncludes();
    assertEquals("Wrong number of includes returned.", 1, includeList.size());
}
Also used : Include(org.eclipse.wst.xsl.core.model.Include) Stylesheet(org.eclipse.wst.xsl.core.model.Stylesheet) Test(org.junit.Test)

Aggregations

Stylesheet (org.eclipse.wst.xsl.core.model.Stylesheet)19 Test (org.junit.Test)12 Function (org.eclipse.wst.xsl.core.model.Function)3 Import (org.eclipse.wst.xsl.core.model.Import)2 Include (org.eclipse.wst.xsl.core.model.Include)2 Template (org.eclipse.wst.xsl.core.model.Template)2 Variable (org.eclipse.wst.xsl.core.model.Variable)2 XSLModelObject (org.eclipse.wst.xsl.core.model.XSLModelObject)2 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 CoreException (org.eclipse.core.runtime.CoreException)1 IStructuredModel (org.eclipse.wst.sse.core.internal.provisional.IStructuredModel)1 IDOMDocument (org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument)1 IDOMModel (org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel)1 StylesheetModel (org.eclipse.wst.xsl.core.model.StylesheetModel)1 XSLAttribute (org.eclipse.wst.xsl.core.model.XSLAttribute)1