casa
5.7.0-16
|
A class to apply XSL transformations on an XML document. More...
#include <Misc.h>
Public Member Functions | |
XSLTransformer () | |
The empty constructor. More... | |
virtual | ~XSLTransformer () |
The destructor. More... | |
XSLTransformer (const std::string &xsltPath) | |
A constructor with an XSL transformation. More... | |
void | setTransformation (const std::string &xsltPath) |
A setter to (re) define the XSL transformation associated with the instance of XSLTransformer. More... | |
std::string | operator() (const std::string &xmlPath) |
Overloads operator() so that the instance can be used as a functor to apply the transformation on a given XML document. More... | |
Private Member Functions | |
XSLTransformer & | operator= (const XSLTransformer &rhs) |
XSLTransformer (const XSLTransformer &rsh) | |
Private Attributes | |
xsltStylesheetPtr | cur |
A class to apply XSL transformations on an XML document.
The XSL transformation to be applied is defined when an instance is constructed. The class has its operator operator() overloaded so that the transformation can be applied by using the instance as a functor.
An instance built with an empty constructor will be interpreted as a "neutral" transformation, i.e. a transformation which leaves the XML document unchanged.
asdm::XSLTransformer::XSLTransformer | ( | ) |
The empty constructor.
The instance will leave the XML document unchanged.
|
virtual |
The destructor.
asdm::XSLTransformer::XSLTransformer | ( | const std::string & | xsltPath | ) |
A constructor with an XSL transformation.
The XSL transformation is read in the file whose path is passed as a parameter, then it's parsed and stored in memory.
xslPath | the path ot the file containing the XSL transformation. |
XSLTransformerException; |
|
private |
std::string asdm::XSLTransformer::operator() | ( | const std::string & | xmlPath | ) |
Overloads operator() so that the instance can be used as a functor to apply the transformation on a given XML document.
The XML document to be transformed is expected to be found in a file whose path is passed as a parameter. It is read and parsed and stored into memory, then the XSL transformation associated with the instance is applied to the XML document stored in memory and finally the result of the transformation is converted to a string which is returned to the caller.
xsltPath | a string whose value is the path to the file containing the XML document to be transformed. |
XSLTransformerException. |
|
private |
void asdm::XSLTransformer::setTransformation | ( | const std::string & | xsltPath | ) |
A setter to (re) define the XSL transformation associated with the instance of XSLTransformer.
The XSL transformation is read in the file whose path is passed as a parameter, then it's parsed and stored in memory.
xslPath | the path ot the file containing the XSL transformation. |
XSLTransformerException. |
|
private |