Age | Commit message (Collapse) | Author |
|
* external DOM may cause xercesc::DOMException's to be thrown instead of passing all errors to the custom error handlers
** these exceptions are handled by this commit by setting the "result" attribute to "error" and adding "error" value nodes with further information
|
|
* replaced std::tuple constructing Mapper template methods with direct XObjectArgVectorType unpacking
** XObjectValue::get template method is applied directly using parameter pack unpacking
* implemented custom IndexSequence / Sequence type to provide vector indexes
* modified all external functions to provide matching constructDocument overloads
|
|
* removes xalan and boost::filesystem::fstream dependencies from FunctionReadXmlFile
* xercesc provides a solution for loading files into it's XercesDOMParser class
** this should be used instead of building a custom replacement using boost's fstream and xalan::XSLTInputSource
|
|
* the root node of the result tree of each function is a domain element
** i.e. the root node of "read-xml-file" is "file", the root node of "read-directory" is "directory"
* the root node contains the result state of the function call encoded in a "result" attribute
** possible values are "success" and "error"
** the root node may contain additional attributes such as the target path of a called transformation
* the actual function result is contained within the child nodes of the function root node
** i.e. the XML file tree returned by "read-xml-file" is a child of the function root node
** if specific errors occured they are also returned as child nodes of the function root node
*** this is currently only the case for "transform" where transformation errors are returned as "error" value node childs of the function root node
* updated test cases accordingly
|
|
* wraps result node construction and appends it to root node on destruction
* offers a simpler interface for common node construction patterns
* simplifies result node construction in all external function implementations
** most noticeable in FunctionReadDirectory
* expanded FunctionReadDirectory result nodes by name, extension, and full-path nodes
|
|
* InputXSLT is dependent on boost anyway, so there is no argument to be made to emulate boost::optional using std::pair
|
|
* if a given file can not be located relative to the transformation's location both "read-file" and "read-xml-file" will now try to resolve the path using the IncludeEntityResolver
* all external functions based on the FunctionBase template are now provided with a pointer to a IncludeEntityResolver instance
* it is determined by the external function implementation whether include path resolution will be used
|
|
* names matter, from now on parameters to external functions will be called parameters uniformly instead of mixing arguments and parameters
|
|
* FunctionBase::argument_tuple is a std::tuple specialization type specialized on the argument types passed inside the variadic template argument of FunctionBase
* added tuple Mapper and XObjectValue helper namespaces containing recursive tuple construction and XObjectPtr value extraction logic
* changed all external function implementations accordingly
* this change was implemented to uniformly support different external function argument types than std::string
|
|
* external functions may expect arguments with a type different from boost::filesystem::path so they are only provided raw string values
* moved xalan string conversion logic into separate compilation unit
|
|
* constructDocument member method is provided with a FunctionBase::argument_array instance
* improved argument validation in FunctionBase
* this parameter was added to support FunctionBase as a base class for FunctionTransform
|
|
* common parts were moved into CRTP template base class _FunctionBase_
* all external functions are derived from that class
** only have to implement _constructDocument_ member method
** currently only supports a single string input parameter which is enough for now
* this change condenses external funtion implementations to the essential and should increase readability as well as maintainability
|
|
* this change makes the underlying similarity between all currently implemented external functions obvious
* they more or less only differ in their document construction logic
** i.e. there is a possibility for a second layer of abstraction between the classes derived from xalan::Function and the actual functionality
* added boost::filesystem::path taking overload of the _iterate_ member method to FilesystemGuard
** this overload functions as the _master_ overload that is called by all other overloads which merely perform type conversion and path resolution
** this overload doesn't perform path resolution
|
|
* all instantiations of a FilesystemContext are currently based on information provided by a xalan::Locator instance provided to the external function execute member method
* this change hides the stylesheet path extraction from the actual function implementation
|
|
* DomDocumentCache::item class now is _finalized_ by default and doesn't perform document instantiation, just lifetime management
** xercesc::DOMDocument is instantiated inside the external function implementations and committed to the document cache for conversion to a xalan document
* added mutex with scoped lock to prevent concurrent write access to the std::unordered_map contained withing DomDocumentCache
* functionality of the _get_ member method was split into _get_ and _create_
** added typedef for std::pair specialization type "optional_item" that functions as the return value of _create_ and _get_
* "locator->getSystemId()" was leaking memory as xerces doesn't manage the lifetime of the returned heap-allocated char array
** analog to XMLCh* strings
** transformed XercesStringGuard into template class to be instantiated on either XMLCh or char
|
|
* up until now all external functions were locally installed to a specific XalanTransformer instance contained within a TransformationGuard instance
** this had to change as I planned to add a "execute-transformation" function based on TransformationGuard which would have led to recursive self-instantiation
** global external functions have to be thread-safe
* as global external function can not be provided with a reference to a transformation-specific FilesystemFacade instance, the working path is now determined using xalan::Locator
** currently using pointer arithmetics on XMLCh* to remove the "file://" prefix of the URI returned by locator->getSystemId(), may be unsafe
* added compilation unit for PlattformGuard as it now contains function installation in addition to plattform lifetime management
|
|
* it was moved into functions local to the respective compilation unit to improve readability
** splits DOM tree construction logic from the actual purpose of the external function
|
|
* all functions return a single "error" node in the case that something went wrong
* otherwise they return one or more "result" nodes that contain the function results and may be distinguished by one or more attributes
* this makes handling the return values easier and more pleasing to the eye as not everything has to be prefixed by "self::*"
* updated test transformation accordingly
|
|
* XML tree is contained below the _content_ node if read was successful
** status is set to error otherwise
* updated test transformation accordingly
|
|
* execute member method internal argument count checks are not needed when using between one and two arguments
** xalan automatically generates the appropriate message containing the getError message when only offered fixed argument execute member overloads
* improved FunctionReadDirectory attribute element generation
* added additional validations to FunctionReadFile and FunctionReadXMLFile
* I plan to return errors inside a DOM tree alongside the function return values in the future
|
|
* this class provides methods for resolving paths relative to the contained base path
* other filesystem interaction methods will also be implemented in this class
** for instance directory traversal
|
|
* while plain read access on files is doesn't require boost::filesystem it will greatly simplify the implementation of external directory traversal functions
* it also improves the portability of relative path construction
|
|
* one expects a read-file function to work relative to the directory the transformation is located and not to the executable's location
** from the perspective of the user the transformation is the application, not the actual executable
* removed PlattformGuard struct from TransformerGuard (now TransformerFacade)
* TransformerFacade is instatiated with the appropriate relative working path
** i.e. it will have to be instantiated for every directory containing one or more transformations
|
|
* .. in the face of the planned development of usable external functions using the current proof-of-concept coding
* replaced usage of std::shared_ptr in FunctionReadXmlFile class with explicit implementation of default and copy constructor
* separated implementation and interfaces
|