Age | Commit message (Collapse) | Author |
|
* 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
|
|
* 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
|
|
* xercesc requires XMLCh* strings to be hand-allocated and released using the XMLString class
* XercesStringGuard works as a scope-guard for XMLCh* string lifetime and greatly simplifies xerces DOM construction
|
|
* 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
|
|
* Wrapped xerces DOM and support class instances in now DomDocumentGuard scope-guard class
* FunctionReadDirectory class contains interal std::stack instance to store DomDocumentGuard instances
** wrapped in std::shared_ptr as FunctionReadDirectory is internally cloned by xalan...
** this is needed as the DOM has to preserved longer than the external function execution scope
* Sadly XMLCh xerces strings have to be manually released
** added appropriate xercesc::XMLString::release calls
* xalan::XercesDOMWrapperParsedSource does not mirror a given xerces DOM but convert it on instantiation
** this is why there is a dedicated finalize member method in InputXSLT::DomDocumentGuard
* In short: I do not like the amount of trickery needed to simply prevent memory leaks in this context
** there sadly doesn't seem to be a substantially easier way to return arbitrary DOM trees from a external function
|
|
* _read-directory_ lists all files in a given directory
** currently text-only output, xml planned
* improved FilesystemContext path resolution (relative path is fully resolved by boost::filesystem)
|
|
* 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
|
|
* there is no reason for performing system-calls instead of using the features offered by the standard library in this situation
|
|
* 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
|
|
* InputXSLT::PlattformGuard handles xerces and xalan construction and lifetime
* InputXSLT::TransformerGuard instantiates PlattformGuard, configurates external functions
** offers execute method for "executing" a XSL tranformation with empty input
|
|
* .. 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
|
|
* command "read-xml-file" reads a XML file and allows it to be transformed by the calling XSLT
* this will allow workflows like the following:
** a tranformation reads all the markdown files in a directory
** these markdown files are converted to a xml representation by a external function calling a appropriate C++ markdown parser
** the XML representation of each markdown file is converted to XHTML inside the XSL transformation
** ... and embedded into the output XHTML document
** => all inside a single XSL tranformation
*** i.e. it is provided with only a empty dummy XML input file and fetches the actual input by itself
* as all current code contained within this repository this is just a quick and dirty proof-of-concept and not in any way good code
|
|
* changed relative paths of input files to accomodate builds inside a separate directory
|