Good day! I need to write a xsl-fo template but I don't have access to the source XML. Is there a way how top print the source XML into a PDF so that I can copy it from the PDF then and paste into a file? It should have the same structure as the source xml including attributes. Please how to do it? Thank you in advance! Vojtech
Edited: I have a web interface where I can paste my template and a PDF is generated. But I don't exactly know what is the structure of the XML used as data source. So I need to write another template which will read input XML (elements, attributes, structure) and write it into a PDF. I'd like to copy content of the PDF then and save it into a file.xml so that I can study it.
Here you will find an excellent article about copying source XML.
I've just wrapped it into a simple XSL-FO stub, so full credit to the original author. Here's the full snippet:
Here's another option that is greatly simplified; just print a copy of the entire XML.
Example:
XML Input
XSLT 1.0
XSL-FO Output
PDF Output (Apache FOP)