casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Private Member Functions | Private Attributes
asdm::XSLTransformer Class Reference

A class to apply XSL transformations on an XML document. More...

#include <Misc.h>

List of all members.

Public Member Functions

 XSLTransformer ()
 The empty constructor.
virtual ~XSLTransformer ()
 The destructor.
 XSLTransformer (const std::string &xsltPath)
 A constructor with an XSL transformation.
void setTransformation (const std::string &xsltPath)
 A setter to (re) define the XSL transformation associated with the instance of XSLTransformer.
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.
 XSLTransformer ()
 The empty constructor.
virtual ~XSLTransformer ()
 The destructor.
 XSLTransformer (const std::string &xsltPath)
 A constructor with an XSL transformation.
void setTransformation (const std::string &xsltPath)
 A setter to (re) define the XSL transformation associated with the instance of XSLTransformer.
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.

Private Member Functions

XSLTransformeroperator= (const XSLTransformer &rhs)
 XSLTransformer (const XSLTransformer &rsh)
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 361 of file Misc.h.


Constructor & Destructor Documentation

The empty constructor.

The instance will leave the XML document unchanged.

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;

The empty constructor.

The instance will leave the XML document unchanged.

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;

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.
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]
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.
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

Definition at line 415 of file Misc.h.


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