aboutsummaryrefslogtreecommitdiff
path: root/src/transformation_facade.cc
AgeCommit message (Collapse)Author
2014-05-10Implemented StylesheetParameterGuard classAdrian Kummerländer
* removes responsibility for clearing parameters from the generate member methods * abstracts parameter escaping and setting and handles map conversion * marked actual generate member method as private and added StylesheetParameterGuard reference argument ** "frontend" generate member methods instantiate a StylesheetParameterGuard instance and pass it to the actual generate method ** this enables central default parameter definition while offering the possibility for custom parameters
2014-05-09Added default target file and path parametersAdrian Kummerländer
* the transformation is now provided with default parameters such as the target file and its parent directory * added appropriate test case ** default_params * test frontend now doesn't provide a "test" parameter anymore * extracted parameter setter into separate member method "setParameters" of TransformationFacade
2014-05-02Changed external functions to enable global installationAdrian Kummerländer
* 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
2014-05-01Added basic parameter taking overload of TransformationFacade::generateAdrian Kummerländer
* XSLT stylesheets may be provided with a set of initial parameters ** these parameters can be provided as the second argument to the generate member method in the form of a string to string mapping ** the XSLT standard also permitts number and node set types as value arguments of such input parameters but this is not supported by this change * expanded test transformation to demonstrate this feature
2014-05-01Changed namespace for external functions to InputXSLTAdrian Kummerländer
* "InputXSLT" is defined as "function.inputxslt.application" * functions can now be accessed like "InputXSLT:read-file('../')" * updated test transformation accordingly * the XML standard does not require namespaces to be real, valid HTTP-URIs but treats them as plain strings
2014-04-26Moved DomDocumentCache instances back into external function classAdrian Kummerländer
* A global DomDocumentCache instance would require key prefixing * switched internal data structure to std::unordered_map for average constant time access
2014-04-26Implemented global DOM document cacheAdrian Kummerländer
* the plan to return XML-nodes from each external function requires a better way to manage the lifetime of many xerces DOM document instances and their support class instances ** this is why DomDocumentCache and DomDocumentCache::item were implemented ** based on std::map so we can easily access the result of old function calls * changed external read-directory function to return the children of the document node instead of the document node itself ** removes unnecessary cruft in function calls ** will make returning status codes alongside the function result more pleasing to the eye * updated test transformation to reflect new features
2014-04-25Improved argument resolution and error handlingAdrian Kummerländer
* 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
2014-04-24Expanded FunctionReadDirectory class to return files and directoriesAdrian Kummerländer
* they are marked appropriately by a _type_ attribute
2014-04-24Changed TransformerFacade into TransformationFacade for single XSLTsAdrian Kummerländer
* contains a single, compiled transformation as specified by its construction argument * uses the transformation's location as the FilesystemContext * allows generation of output documents using _generate_ member method