ui-gxmlcpp 1.4.6
Public Types | Public Member Functions | Protected Member Functions | Friends
UI::GXML::XSLTree Class Reference

XSL (stylesheet) Tree. More...

#include <XSLTree.hpp>

Inheritance diagram for UI::GXML::XSLTree:
Inheritance graph
Collaboration diagram for UI::GXML::XSLTree:
Collaboration graph

Public Types

enum  ErrorCode { Style_ = 0 }
 Error codes for exceptions.
 
typedef CodeException< ErrorCodeException
 Exceptions for this class.
 
- Public Types inherited from UI::GXML::Tree
enum  ErrorCode { Parse_ , Mem_ , NoNode_ , Internal_ }
 Error codes for exceptions.
 
typedef CodeException< ErrorCodeException
 Exceptions for this class.
 
typedef std::map< std::string, std::string > NamespaceMap
 Structure holding namespaces for xPath expressions.
 
enum  FileConstructor { File_ }
 Helper enum for constructor from file name.
 

Public Member Functions

 ~XSLTree ()
 
std::string getOutputEncoding () const
 Get output charset encoding (i.e., what is specified in xsl::output); empty if none is specified.
 
Standard tree constructors.
See also
UI::GXML::Tree.
 XSLTree (char const *xml, int len=-1, std::string const &base=DefaultDocbase_, int const options=0)
 
 XSLTree (std::string const &xml, std::string const &base=DefaultDocbase_, int const options=0)
 
 XSLTree (std::istream &xml, std::string const &base=DefaultDocbase_, int const options=0)
 
 XSLTree (FileConstructor const dummy, std::string const &file, int const options=0)
 
- Public Member Functions inherited from UI::GXML::Tree
Treeoperator= (Tree const &tree)
 Copy operator.
 
bool operator== (Tree const &tree)
 Comparison.
 
TreesetTopLevelNamespaces ()
 
TreesetXPathNamespace (std::string const &prefix, std::string const &uri)
 Set custom xml namespace known in xPath queries.
 
std::string dump (bool const &format=false, std::string const &encoding=DefaultEncoding_) const
 Tree dump shortcut.
 
std::string formatDump (std::string const &encoding=DefaultEncoding_) const
 As dump, but will reparse the tree first.
 
std::string getOrigEncoding () const
 Get original document's encoding.
 
void setName (std::string const &xpath, std::string const &name)
 Set name of node(s).
 
void unlink (std::string const &xpath)
 Remove node(s) from tree.
 
TreesetContext (bool on=true)
 (Un)configure the tree to use a fix xpath context.
 
XPathContextgetContext () const
 Get fixed context.
 
XPathObject getXPathObject (std::string const &xpath) const
 
NodeSet getNodeSet (std::string const &xpath) const
 
Node getNode (std::string const &xpath, bool const &doThrow=true) const
 
Node getRootNode () const
 Shortcut to get the root node.
 
int getCount (std::string const &xpath) const
 
bool exists (std::string const &xpath, int const times=1) const
 
char const * getContentC (std::string const &xpath) const
 
std::string getContent (std::string const &xpath) const
 
void setContent (std::string const &xpath, std::string const &content)
 
void setAttribute (std::string const &xpath, std::string const &name, std::string const &content)
 
std::string getAttribute (std::string const &xpath, std::string const &name) const
 
Node addChild (std::string const &xpath, std::string const &name, std::string const &content="")
 
Node addChild (std::string const &xpath, Node const &node)
 
void addTree (std::string const &xpath, Tree const &source, std::string const &sourceXPath="/*")
 
void addXML (std::string const &xpath, std::string const &source, std::string const &sourceXPath="/*")
 
 Tree (char const *xml, int len=-1, std::string const &base=DefaultDocbase_, int const options=0)
 Construct from C string or buffer.
 
 Tree (std::string const &xml, std::string const &base=DefaultDocbase_, int const options=0)
 Construct from string.
 
 Tree (std::istream &xml, std::string const &base=DefaultDocbase_, int const options=0)
 Construct from istream.
 
 Tree (FileConstructor const &dummy, std::string const &file, int const options=0)
 Construct from file name.
 
 Tree (Tree const &tree)
 Construct from another Tree.
 

Protected Member Functions

xsltStylesheet * getStylesheet () const
 Get libxml2 stylesheet struct.
 
- Protected Member Functions inherited from UI::GXML::Tree
 Tree ()
 Protected default constructor.
 
TreesetDontFreeDoc (bool on=true)
 En/disable freeing of underlying libxml2 doc_ tree. Use with caution.
 

Friends

class XSLTransTree
 We need to access libxml2 doc pointer to parse the stylesheet with libxml2 function.
 

Additional Inherited Members

- Static Public Attributes inherited from UI::GXML::Tree
static std::string const DefaultEncoding_
 Default encoding. This is used for any dumps if not specified otherwise.
 
static std::string const DefaultEncodings_
 Comma-separated uppercase list of the name and all allowed aliases the default encoding.
 
static std::string const DefaultDocbase_
 Default document base. This is used for from-memory parsing if not specified otherwise.
 
- Protected Attributes inherited from UI::GXML::Tree
NamespaceMap xPathNamespaces_
 Prefixs and URIs for custom xml namespaces in xPath queries.
 

Detailed Description

XSL (stylesheet) Tree.

Examples
XSLTProc.cpp.

Constructor & Destructor Documentation

◆ ~XSLTree()

UI::GXML::XSLTree::~XSLTree ( )
Note
xsltFreeStylesheet frees underlying xmlDoc as well, so we need to disable calling xmlFreeDoc in ~Tree.

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