www.altova.com
Previous  Top  Next

XSLT2


public class XSLT2

extends java.lang.Object

implements IXSLT

 

Iplemented interfaces: IAltovaXMLEngine, IExecutable, IReleasable, IXSLT

 

 

Description

Class holding the XSLT 2.0 engine. No direct construction/access possible. Get the IXSLT interface to it by calling the function getXSLT2Instance() on an instance of IAltovaXMLFactory. Note that the XSLT 2.0 Engine can be used in its backward compatibility mode to process an XSLT 1.0 stylesheet. The output, however, could be different than that produced by the XSLT 1.0 Engine processing the same XSLT 1.0 stylesheet.

 

 

Constructors

The following constructor is defined.

 

XSLT2

protected XSLT2(long nXSLT2Ptr)

 

 

Methods

The following methods are defined.

 

releaseInstance

public void releaseInstance()

Releases the object's connection to the COM server.

Specified by:

releaseInstance in interface IReleasable.

 

 

execute

public boolean execute(java.lang.String sOutFile)

Executes and saves the result to file. In case of an error, you can use the function getLastErrorMessage() declared in IAltovaXMLEngine to get additional information.

Specified by:

execute in interface IExecutable.

Parameters:

sOutFile: an absolute URL giving the location of the output file.

Returns:

true on success, false on error.

 

 

executeAndGetResultAsString

public java.lang.String executeAndGetResultAsString()

Executes and returns the result as a UTF-16 text string. In case of an error, you can use the function getLastErrorMessage() declared in IAltovaXMLEngine to get additional information.

Specified by:

executeAndGetResultAsString in interface IExecutable.

Returns:

string containing the serialized result. On error, will return the empty string.

 

 

setInputXMLFileName

public void setInputXMLFileName(java.lang.String str)

Sets the file name for the input XML data. Note that you have to use absolute URLs.

Specified by:

setInputXMLFileName in interface IAltovaXMLEngine.

Parameters:

str: an absolute URL giving the base location of the XML data.

 

 

setInputXMLFromText

public void setInputXMLFromText(java.lang.String str)

Sets the text value for the input XML data. Example: setInputXMLFromText( "<doc> <a>text</a> </doc>" ).

Specified by:

setInputXMLFromText in interface IAltovaXMLEngine.

Parameters:

str: a string containing XML data.

 

 

getLastErrorMessage

public java.lang.String getLastErrorMessage()

Gets the last error message from the engine.

Specified by:

getLastErrorMessage in interface IAltovaXMLEngine.

Returns:

a string containing the last error message.

 

 

setXSLTFileName

public void setXSLTFileName(java.lang.String str)

Sets the file name for the XSLT data.

Specified by:

setXSLTFileName in interface IXSLT.

Parameters:

str: an absolute URL giving the base location of the XSLT data

 

 

setXSLTFromText

public void setXSLTFromText(java.lang.String str)

Sets the text value for the XSLT data.

Specified by:

setXSLTFromText in interface IXSLT.

Parameters:

str: a string containing serialized XSLT data.

 

 

addExternalParameter

public void addExternalParameter(java.lang.String strName,

                                java.lang.String strVal)

Adds the name and value of an external parameter.

Specified by:

addExternalParameter in interface IXSLT.

Parameters:

strName: a string containing a valid QName as the parameter name.

strVal: a string containing the value of the parameter; this value will be evaluated as an XPath expression.

 

 

clearExternalParameterList

public void clearExternalParameterList()

Clears the list of external parameters.

Specified by:

clearExternalParameterList in interface IXSLT.

 

 

setXSLTStackSize

public void addExternalParameter(long nVal)

The stack size is the maximum depth of executed instructions. If the stack size is exceeded during a transformation, an error is reported.

Specified by:

setXSLTStackSize in interface IXSLT.

Parameters:

nVal: numeric value for new stack size. Must be greater tha 100. The initial value 1000.

 


Previous  Top  Next

© 2008 Altova