casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
asdm::XSLTransformer Class Reference

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

XSLTransformeroperator= (const XSLTransformer &rhs)
 
 XSLTransformer (const XSLTransformer &rsh)
 

Private Attributes

xsltStylesheetPtr cur
 

Detailed Description

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.

Definition at line 444 of file Misc.h.

Constructor & Destructor Documentation

asdm::XSLTransformer::XSLTransformer ( )

The empty constructor.

The instance will leave the XML document unchanged.

virtual asdm::XSLTransformer::~XSLTransformer ( )
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.

Parameters
xslPaththe path ot the file containing the XSL transformation.
Exceptions
XSLTransformerException;
asdm::XSLTransformer::XSLTransformer ( const XSLTransformer rsh)
private

Member Function Documentation

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.

Parameters
xsltPatha string whose value is the path to the file containing the XML document to be transformed.
Returns
a string containing the result of the transformation applied to the XML document.
Exceptions
XSLTransformerException.
XSLTransformer& asdm::XSLTransformer::operator= ( const XSLTransformer rhs)
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.

Parameters
xslPaththe path ot the file containing the XSL transformation.
Exceptions
XSLTransformerException.

Member Data Documentation

xsltStylesheetPtr asdm::XSLTransformer::cur
private

Definition at line 498 of file Misc.h.


The documentation for this class was generated from the following file: