I have been using Altova Map Force to build XSL transformations recently, and I have come across an issue. In order to create a valid XML output file (from an input text file, which was simple enough to build), it needs to contain some xmlns attribute tags.
Unfortunately, I cannot find a way to do this validly (modified the output xsd schema def and attribute forcing) within Map Force or my Data Transformation Tool (built by the client I am building this for, based on Saxon). So, my solution is to parse the generated XML into another (final) transformer where the XML Elements of the File are transformed into a single text block that contains a string representation of the XML (i.e. the file string that is returned), then trim off the parent element declaration, and modify it with the amended element (with the xmlns attribute), then output that to save.
I have done some tests, and I can do this validly, but in that test, I was parsing in a pre-converted xml string that had the function applied to it. So, can anyone advise me as to how, within xslt, I can convert a collection of elements into a string that I can modify and return as CDATA (which the transformer program will convert treat as a string and dump it straight into the output file)?