Package org.eclipse.wst.xsl.core


org.eclipse.wst.xsl.core
Class XSLCore



public class XSLCore
extends java.lang.Object
The interface to all aspects of the XSL core functionality.

This is responsible for building and maintaining the cache of built XSL models.


Field Summary

public static java.lang.StringXSL_CONTENT_TYPE
     The XSL content type (= org.eclipse.wst.xml.core.xslsource)
public static java.lang.StringXSL_NAMESPACE_URI
     The XSL namespace URI (= http://www.w3.org/1999/XSL/Transform)

Method Summary

public org.eclipse.wst.xsl.core.model.StylesheetModelbuildStylesheet(IFile file)
     Completely rebuild the source file from its DOM
public voidclean(IProject project , IProgressMonitor monitor)
     Clean all of the stylesheets from the given project.
public static org.w3c.dom.AttrgetCurrentAttrNode(org.w3c.dom.Node node , int offset)
     Returns an Attr node for the current Node if one exits at the specified offset.
public static org.w3c.dom.NodegetCurrentNode(IDocument document , int offset)
     Returns the current Node at the specified offset.
public static org.eclipse.wst.xsl.core.XSLCoregetInstance()
     Get the singleton XSLCore instance.
public org.eclipse.wst.xsl.core.model.StylesheetModelgetStylesheet(IFile file)
     Get the cached stylesheet, or build it if it has not yet been built.
public static booleanisXMLFile(IFile file)
     Determine whether the given file is an XML file by inspecting its content types.
public static booleanisXSLFile(IFile file)
     Determine whether the given file is an XSL file by inspecting its content types.
public static booleanisXSLNamespace(org.w3c.dom.Node node)
     Takes a given Node and returns whether it is part of the the XSLT Namespace.
public static IFileresolveFile(IFile currentFile , java.lang.String uri)
     Locates a file for the given current file and URI.

Field Detail

XSL_CONTENT_TYPE

public static java.lang.String XSL_CONTENT_TYPE

The XSL content type (= org.eclipse.wst.xml.core.xslsource)

XSL_NAMESPACE_URI

public static java.lang.String XSL_NAMESPACE_URI

The XSL namespace URI (= http://www.w3.org/1999/XSL/Transform)

Methods Detail

buildStylesheet

public org.eclipse.wst.xsl.core.model.StylesheetModel buildStylesheet(IFile file)

Completely rebuild the source file from its DOM

Parameters

file

Returns

org.eclipse.wst.xsl.core.model.StylesheetModel - the stylesheet model, or null if it could not be created.


clean

public void clean(IProject project , IProgressMonitor monitor)

Clean all of the stylesheets from the given project.

Parameters

project - the project to be cleaned

monitor - a progress monitor to track the clean progress


getCurrentAttrNode

public org.w3c.dom.Attr getCurrentAttrNode(org.w3c.dom.Node node , int offset)

Returns an Attr node for the current Node if one exits at the specified offset.

Parameters

node

offset

Returns

org.w3c.dom.Attr - A w3c.dom.Attr


getCurrentNode

public org.w3c.dom.Node getCurrentNode(IDocument document , int offset)

Returns the current Node at the specified offset.

Parameters

document

offset

Returns

org.w3c.dom.Node - an w3c.dom.Node


getInstance

public org.eclipse.wst.xsl.core.XSLCore getInstance()

Get the singleton XSLCore instance.

Returns

org.eclipse.wst.xsl.core.XSLCore - the XSLCore instance


getStylesheet

public org.eclipse.wst.xsl.core.model.StylesheetModel getStylesheet(IFile file)

Get the cached stylesheet, or build it if it has not yet been built.

Parameters

file

Returns

org.eclipse.wst.xsl.core.model.StylesheetModel - source file, or null if could not be built


isXMLFile

public boolean isXMLFile(IFile file)

Determine whether the given file is an XML file by inspecting its content types.

Parameters

file - the file to inspect

Returns

boolean - true if this file is an XML file


isXSLFile

public boolean isXSLFile(IFile file)

Determine whether the given file is an XSL file by inspecting its content types.

Parameters

file - the file to inspect

Returns

boolean - true if this file is an XSL file


isXSLNamespace

public boolean isXSLNamespace(org.w3c.dom.Node node)

Takes a given Node and returns whether it is part of the the XSLT Namespace.

Parameters

node - The Node to be checked.

Returns

boolean - True if part of the XSLT namespace, false otherwise.


resolveFile

public IFile resolveFile(IFile currentFile , java.lang.String uri)

Locates a file for the given current file and URI.

Parameters

currentFile - the file to resolve relative to

uri - the relative URI

Returns

IFile - the file at the URI relative to this currentFile