Table 13-1 summarizes the methods of available through the XSLTVM Interface.
Table 13-1 Summary of XSLTC Methods; XSLTVM Package
Function | Summary |
---|---|
XmlXvmCompileBuffer
|
Compile an XSLT stylesheet from buffer into bytecode. |
XmlXvmCompileDom
|
Compile an XSLT stylesheet from DOM into bytecode. |
XmlXvmCompileFile
|
Compile an XSLT stylesheet from file into bytecode. |
XmlXvmCompileURI
|
Compile XSLT stylesheet from URI into byte code. |
XmlXvmCompileXPath
|
Compile an XPath expression. |
XmlXvmCreateComp
|
Create an XSLT compiler. |
XmlXvmDestroyComp
|
Destroy an XSLT compiler object. |
XmlXvmGetBytecodeLength
|
Returns the bytecode length. |
Compile an XSLT stylesheet from buffer into bytecode. Compiler flags could be one or more of the following:
XMLXVM_DEBUG
forces compiler to include debug information into the bytecode
XMLXVM_STRIPSPACE
is equivalent to <xsl:strip-space elements="*"/>
.
The generated bytecode resides in a compiler buffer which is freed when next stylesheet is compiled or when compiler object is deleted. Hence, if the bytecode is to be reused it should be copied into another location.
ub2 *XmlXvmCompileBuffer( xmlxvmcomp *comp, oratext *buffer, ub4 length, oratext *baseURI, xmlxvmflag flags, xmlerr *error);
Parameter | In/Out | Description |
---|---|---|
comp |
IN |
compiler object |
buffer |
IN |
pointer to buffer containing stylesheet document |
length |
IN |
length of the stylesheet document in bytes |
baseuri |
IN |
base URI of the document |
flags |
IN |
flags for the current compilation |
error |
OUT |
returned error code |
(ub2 *)
bytecode or NULL
on error
Compile an XSLT stylesheet from DOM into bytecode. Compiler flags could be one or more of the following:
XMLXVM_DEBUG
forces compiler to include debug information into the bytecode
XMLXVM_STRIPSPACE
is equivalent to <xsl:strip-space elements="*"/>
.
The generated bytecode resides in a compiler buffer which is freed when next stylesheet is compiled or when compiler object is deleted. Hence, if the bytecode is to be reused it should be copied into another location.
ub2 *XmlXvmCompileDom( xmlxvmcomp *comp, xmldocnode *root, xmlxvmflag flags, xmlerr *error);
Parameter | In/Out | Description |
---|---|---|
comp |
IN |
compiler object |
rooot |
IN |
root element of the stylesheet DOM |
flags |
IN |
flags for the current compilation |
error |
OUT |
returned error code |
(ub2 *)
bytecode or NULL
on error
Compile XSLT stylesheet from file into bytecode. Compiler flags could be one or more of the following:
XMLXVM_DEBUG
forces compiler to include debug information into the bytecode
XMLXVM_STRIPSPACE
is equivalent to <xsl:strip-space elements="*"/>
.
The generated bytecode resides in a compiler buffer which is freed when next stylesheet is compiled or when compiler object is deleted. Hence, if the bytecode is to be reused it should be copied into another location.
ub2 *XmlXvmCompileFile( xmlxvmcomp *comp, oratext *path, oratext *baseURI, xmlxvmflag flags, xmlerr *error);
Parameter | In/Out | Description |
---|---|---|
comp |
IN |
compiler object |
path |
IN |
path of XSL stylesheet file |
baseuri |
IN |
base URI of the document |
flags |
IN |
flags for the current compilation |
error |
OUT |
returned error code |
(ub2 *)
bytecode or NULL
on error
Compile XSLT stylesheet from URI into bytecode. Compiler flags could be one or more of the following:
XMLXVM_DEBUG
forces compiler to include debug information into the bytecode
XMLXVM_STRIPSPACE
is equivalent to <xsl:strip-space elements="*"/>
.
The generated bytecode resides in a compiler buffer which is freed when next stylesheet is compiled or when compiler object is deleted. Hence, if the bytecode is to be reused it should be copied into another location.
ub2 *XmlXvmCompileURI( xmlxvmcomp *comp, oratext *uri, xmlxvmflag flags, xmlerr *error);
Parameter | In/Out | Description |
---|---|---|
comp |
IN |
compiler object |
uri |
IN |
URI of the file that contains the XSL stylesheet |
flags |
IN |
flags for the current compilation |
error |
OUT |
returned error code |
(ub2 *)
bytecode or NULL
on error
Compiles an XPath expression. The optional pfxmap
is used to map namespace prefixes to URIs in the XPath expression. It is an array of prefix, URI values, ending in NULL
, and so on.
ub2 *XmlXvmCompileXPath( xmlxvmcomp *comp, oratext *xpath, oratext **pfxmap, xmlerr *error);
Parameter | In/Out | Description |
---|---|---|
comp |
IN |
compiler object |
xpath |
IN |
XPath expression |
pfxmap |
IN |
array of prefix-URI mappings |
error |
OUT |
returned error code |
(ub2 *)
XPath expression bytecode or NULL
on error
Create an XSLT compiler object. The XSLT compiler is used to compile XSLT stylesheets into bytecode.
xmlxvmcomp *XmlXvmCreateComp( xmlctx *xctx);
Parameter | In/Out | Description |
---|---|---|
xctx |
IN |
XML context |
(xmlxvmcomp *)
XSLT compiler object, or NULL
on error
Destroys an XSLT compiler object
void XmlXvmDestroyComp( xmlxvmcomp *comp);
Parameter | In/Out | Description |
---|---|---|
comp |
IN |
XSLT compiler object |
The bytecode length is needed when the bytecode is to be copied or when it is set into XSLTVM.
ub4 XmlXvmGetBytecodeLength( ub2 *bytecode, xmlerr *error);
Parameter | In/Out | Description |
---|---|---|
bytecode |
IN |
bytecode buffer |
error |
OUT |
returned error code |
(ub4)
The bytecode length in bytes.