10 Package Xsl APIs for C++
The Xsl package for C++ contains types and methods related to XSL transformation. They include Xsl datatypes, Compiler methods, CompTransformer methods, Transformer methods, and XSLException methods.
10.1 Xsl Datatypes
Table 10-1 summarizes the datatypes of the Xsl package.
Table 10-1 Summary of Datatypes; Xsl Package
| Datatype | Description |
|---|---|
|
Defines XSL compiler identifiers. |
|
|
Defines XSLT related exceptions. |
|
|
Defines XSL transformer identifiers. |
10.1.1 XslCompIdType
Defines XSL compiler identifiers.
Definition
typedef enum XslCompIdType {
XvmCompCXml = 1
} XslCompIdType;
10.1.2 XslExceptionCode
Defines XSLT related exceptions.
Definition
typedef typedef enum XslExceptionCode {
XSL_UNDEFINED_ERR = 0,
XSL_OTHER_ERR = 1
} XslExceptionCode;
10.2 Compiler Interface
Table 10-2 summarizes the methods available through the Compiler interface.
Table 10-2 Summary of Compiler Methods; Xsl Package
| Function | Summary |
|---|---|
|
Compile Xsl and return its compiled binary representation. |
|
|
Get compiler's Id. |
|
|
Get length of compiled XSL document. |
10.2.1 compile()
Compiles Xsl and returns its compiled binary representation.
Syntax
virtual ub2* compile( InputSource* isrc_ptr) throw (XslException) = 0;
| Parameter | Description |
|---|---|
isrc_ptr |
Xsl document |
Returns
(InputSource) Xsl document in compiled binary representation
10.2.2 getCompilerId()
Get the compiler Id.
Syntax
virtual XslCompIdType getCompilerId() const = 0;
Returns
(XslCompIdType) Compiler's Id
10.3 CompTransformer Interface
Table 10-3 summarizes the methods available through the CompTransformer interface.
Table 10-3 Summary of CompTransformer Methods; Xsl Package
| Function | Summary |
|---|---|
|
Get transformer's Id. |
|
|
Set compiled Xsl. |
|
|
Set SAX handler. |
|
|
Set XSLT document for this transformer. |
|
|
Transform the document. |
10.3.1 getTransformerId()
Get transformer's id.
Syntax
virtual XslTrIdType getTransformerId() const = 0;
Returns
(XslTrIdType) Transformer's Id
10.3.2 setBinXsl()
Sets compiled Xsl.
Syntax
virtual void setBinXsl ( ub2* binxsl_ptr) throw (XslException) = 0;
| Parameter | Description |
|---|---|
binxsl_ptr |
compiled Xsl document |
10.3.3 setSAXHandler()
Inherited from Transformer.
Syntax
virtual void setSAXHandler( SAXHandlerRoot* hdlr_ptr) = 0;
| Parameter | Description |
|---|---|
hdlr_ptr |
SAX handler pointer |
10.3.4 setXSL()
Set XSLT document for this transformer. Should be called before the transform member function is called. It is inherited from Transform.
Syntax
virtual void setXSL ( InputSource* isrc_ptr) throw (XslException) = 0;
| Parameter | Description |
|---|---|
isrc_ptr |
instance document to process |
10.3.5 transform()
Transforms the document. Throws an exception if an XSLT document is not set by a previous call to setXSL. Inherited from Transform.
| Syntax | Description |
|---|---|
virtual NodeRef< Node>* transform( nputSource* isrc_ptr) throw (XslException) = 0; |
Transform the document and return DOM. |
virtual void transform( InputSource* isrc_ptr, SAXHandlerRoot* hdlr_ptr) throw (XslException) = 0; |
Transform the document and return SAX events. |
| Parameter | Description |
|---|---|
isrc_ptr |
instance document to process |
hdlr_ptr |
SAX handler pointer |
Returns
(DocumentRef) document tree of new document
10.4 Transformer Interface
Table 10-4 summarizes the methods available through the Transformer interface.
Table 10-4 Summary of Transformer Methods; Xsl Package
| Function | Summary |
|---|---|
|
Get transformer's Id. |
|
|
Set SAX handler. |
|
|
Set XSLT document for this transformer. |
|
|
Transform the document and return SAX events. |
10.4.1 getTransformerId()
Gets transformer's id.
Syntax
virtual XslTrIdType getTransformerId() const = 0;
Returns
(XslTrIdType) Transformer's Id
10.4.2 setSAXHandler()
Set SAX handler.
Syntax
virtual void setSAXHandler( SAXHandlerRoot* hdlr_ptr) = 0;
| Parameter | Description |
|---|---|
hdlr_ptr |
SAX handler pointer |
10.4.3 setXSL()
Set XSLT document for this transformer. Should be called before the transform member function is called.
Syntax
virtual void setXSL ( InputSource* isrc_ptr) throw (XslException) = 0;
| Parameter | Description |
|---|---|
isrc_ptr |
instance document to process |
10.4.4 transform()
Transforms the document. Throws an exception if an XSLT document is not set by a previous call to setXSL.
| Syntax | Description |
|---|---|
virtual NodeRef< Node>* transform( nputSource* isrc_ptr) throw (XslException) = 0; |
Transform the document and return DOM. |
virtual void transform( InputSource* isrc_ptr, SAXHandlerRoot* hdlr_ptr) throw (XslException) = 0; |
Transform the document and return SAX events. |
| Parameter | Description |
|---|---|
isrc_ptr |
instance document to process |
hdlr_ptr |
SAX handler pointer |
Returns
(DocumentRef) document tree of new document
10.5 XSLException Interface
Table 10-5 summarizes the methods available through the XSLException interface.
Table 10-5 Summary of XSLException Methods; Xsl Package
| Function | Summary |
|---|---|
|
Get Oracle XML error code embedded in the exception. |
|
|
Get current language (encoding) of error messages. |
|
|
Get Oracle XML error message. |
|
|
Defines a prototype for implementation. |
10.5.1 getCode()
Gets Oracle XML error code embedded in the exception. Virtual member function inherited from XmlException.
Syntax
virtual unsigned getCode() const = 0;
Returns
(unsigned) numeric error code (0 on success)
10.5.2 getMesLang()
Virtual member function inherited from XmlException.
Syntax
virtual oratext* getMesLang() const = 0;
Returns
(oratext*) Current language (encoding) of error messages
10.5.3 getMessage()
Virtual member function inherited from XmlException
Syntax
virtual oratext* getMessage() const = 0;
Returns
(oratext *) Error message
10.5.4 getXslCode()
This is a virtual member function that defines a prototype for implementation defined member functions returning XSL transformer and compiler exception codes, defined in XslExceptionCode, of the exceptional situations during execution.
Syntax
virtual XslExceptionCode getXslCode() const = 0;
Returns
(XslExceptionCode) exception code