Elm
2
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) | |
XSLTransform (Document *stylesheet, NodeFactory *factory) | |
void | setParameter (const string &name, const string &value) |
void | setParameter (const string &name, const string &ns, const string &value) |
Document * | toDocument (const Nodes &nodes) |
String | toString (void) |
Nodes | transform (Document *in) |
Nodes | transform (Nodes in) |
Document * | transformDocument (Document *in) |
Public Member Functions inherited from ErrorBase | |
ErrorBase (ErrorHandler *error_handler=&ErrorHandler::DEFAULT) | |
void | setErrorHandler (ErrorHandler *error_handler) |
ErrorHandler * | getErrorHandler (void) const |
Additional Inherited Members | |
Protected Member Functions inherited from 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:
XSLTransform | ( | Document * | stylesheet | ) |
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 |
XSLTransform | ( | Document * | stylesheet, |
NodeFactory * | factory | ||
) |
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 |
namespace | the namespace URI of the parameter |
value | the value of the parameter |
Supply a parameter to transformations performed by this object.
name | the name of the parameter |
value | the value of the parameter |
References ListMap< K, T, C, E, A >::put().
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 ParentNode::appendChild(), Node::ELEMENT, NodeFactory::finishMakingDocument(), Nodes::get(), Node::kind(), Document::setRootElement(), Nodes::size(), and NodeFactory::startMakingDocument().
Returns a string form of this XSLTransform, suitable for debugging.
References Document::toString().
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 |
Transform a document and return it.
in | document to transform. |
References ListMap< K, T, C, E, A >::count(), Node::getNode(), NodeFactory::makeDocument(), and ListMap< K, T, C, E, A >::pairs().