Elm
1.0
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
#include <elm/xom/XSLTransform.h>
Public Member Functions | |
XSLTransform (Document *stylesheet) throw (XSLException) | |
XSLTransform (Document *stylesheet, NodeFactory *factory) throw (XSLException) | |
void | setParameter (const string &name, const string &value) |
void | setParameter (const string &name, const string &ns, const string &value) |
Document * | toDocument (const Nodes &nodes) throw (XMLException) |
String | toString (void) |
Nodes | transform (Document *in) throw (XSLException) |
Nodes | transform (Nodes in) throw (XSLException) |
Document * | transformDocument (Document *in) throw (XSLException) |
Public Member Functions inherited from elm::ErrorBase | |
ErrorBase (ErrorHandler *error_handler=&ErrorHandler::DEFAULT) | |
void | setErrorHandler (ErrorHandler *error_handler) |
ErrorHandler * | getErrorHandler (void) const |
Additional Inherited Members | |
Protected Member Functions inherited from elm::ErrorBase | |
void | onError (error_level_t level, const string &message) |
Serves as an interface to a XSLT processor. The following example shows how to apply an XSL Transformation to a XOM document and get the transformation result in the form of a XOM Nodes:
elm::xom::XSLTransform::XSLTransform | ( | Document * | stylesheet | ) | |
throw | ( | XSLException | |||
) |
Creates a new XSLTransform by reading the stylesheet from the supplied document.
stylesheet | document containing the stylesheet |
XSLException | when the supplied document is not syntactically correct XSLT |
elm::xom::XSLTransform::XSLTransform | ( | Document * | stylesheet, |
NodeFactory * | factory | ||
) | |||
throw | ( | XSLException | |
) |
Creates a new XSLTransform by reading the stylesheet from the supplied document. The supplied factory will be used to create all nodes in the result tree, so that a transform can create instances of subclasses of the standard XOM classes. Because an XSL transformation generates a list of nodes rather than a document, the factory's startMakingDocument and finishMakingDocument methods are not called.
stylesheet | document containing the stylesheet |
factory | the factory used to build nodes in the result tree |
XSLException | when the supplied document is not syntactically correct XSLT |
Supply a parameter to transformations performed by this object.
name | the name of the parameter |
value | the value of the parameter |
References elm::genstruct::AssocList< K, T, C, E, N >::put().
void elm::xom::XSLTransform::setParameter | ( | const string & | name, |
const string & | ns, | ||
const string & | value | ||
) |
Supply a parameter to transformations performed by this object.
name | the name of the parameter |
namespace | the namespace URI of the parameter |
value | the value of the parameter |
Document * elm::xom::XSLTransform::toDocument | ( | const Nodes & | nodes | ) | |
throw | ( | XMLException | |||
) |
Creates a new Nodes object from the input Nodes object by applying this object's stylesheet. The original Nodes object is not changed.
in | document to transform |
XSLException | if the transformation fails, normally due to an XSLT error all nodes passed in in parameter are cleaned up |
References elm::xom::ParentNode::appendChild(), elm::xom::Node::ELEMENT, elm::xom::Node::get(), and elm::xom::Document::setRootElement().
String elm::xom::XSLTransform::toString | ( | void | ) |
Returns a string form of this XSLTransform, suitable for debugging.
References elm::xom::Document::toString().
Nodes elm::xom::XSLTransform::transform | ( | Document * | in | ) | |
throw | ( | XSLException | |||
) |
Creates a new Nodes from the input Document by applying this object's stylesheet. The original Document is not changed.
in | document to transform |
XSLException | if the transformation fails, normally due to an XSLT error |
Nodes elm::xom::XSLTransform::transform | ( | Nodes | in | ) | |
throw | ( | XSLException | |||
) |
Not currently supported.
Document * elm::xom::XSLTransform::transformDocument | ( | Document * | in | ) | |
throw | ( | XSLException | |||
) |
Transform a document and return it.
in | document to transform. |
References elm::io::in.