Subject:XML with XSD to PDF Author:Adam M Date:06 Aug 2013 11:56 AM
I know there are posts about this topic but for some reason I still can not figure out how to do it. I have an xml and xsd that I created on my own. I was to add it to Stylus and create a pdf.
XML looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:attribute-set name="padding">
<xsl:attribute name="padding-bottom">0.25pt</xsl:attribute>
<xsl:attribute name="padding-top">0.25pt</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="text">
.....
o:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="A4" margin-left="0.5in" margin-right="0.5in" page-height="11in" page-width="8.5in" margin-top="0.5in" margin-bottom="0.5in">
<fo:region-before region-name="region-header" extent="10.0pt"/>
<fo:region-body region-name="region-body" margin-top="10.0pt" margin-bottom="10.0pt"/>
<fo:region-after region-name="region-footer" extent="10.0pt" display-align="after"/>
</fo:simple-page-master>
</fo:layout-master-set>
.....
With the XSD
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="DOCUMENT">
<xs:complexType>
<xs:sequence>
<xs:element ref="DATE"/>
<xs:element ref="USER_NAME"/>
.....
I use Oracle APEX to generate the PDF but I want to use Stylus to preview them. Exactly how do I upload these file and view them as a pdf? Thanks.
Subject:XML with XSD to PDF Author:Ivan Pedruzzi Date:06 Aug 2013 02:43 PM
Hi Adam,
if your XSLT is designed to generate XSL-FO as it appears to be, got to the scenario dialog and click on the post process tab, in there click on Apache FOP or RenderX.
After doing that, every time you will be executing the transformation Stylus Studio will run the FO processor which should render the PDF in the preview window.
Subject:XML with XSD to PDF Author:Adam M Date:06 Aug 2013 03:41 PM
Thanks. So as far as the steps, this is what I did:
1) File->New->XSLT Stylesheet
2) Past my xml code in there
3) Edit the Scenario in the Post-processing tab to Apache FOP
4) Preview
This worked and gave me a preview of the pdf. Is there a way to link the xsd file to it and is there another way to doing this? Thanks again.
Subject:XML with XSD to PDF Author:Ivan Pedruzzi Date:06 Aug 2013 04:00 PM
Adam,
I assume you have an XML file to use as input to the transformation and, the XML schema describes such input.
The XML input document structure can be used to drive the XSLT code generation, you can drug & drop elements from the right inside into the editor to create xsl:for-each, value-of, etc.
You can also enhance the XPath auto-complete feature, plugging your schema
1) Create a folder in the Stylus Studio project
2) add your XSLT file
3) Right click on the project folder then click Associate Schema to folder
Now the auto-complete is aware of your schema definitionf
Subject:XML with XSD to PDF Author:Adam M Date:06 Aug 2013 05:18 PM
Correct. Instead of Drag and dropping the elements, I just created a new XSLT stylesheet and replaced the content with my xml input file. The xsd is the schema that describes the xml input file.
I created a folder within the project and added the xsd file as the schema as you mentioned above. I then ran the preview and see the pdf. Many things to learn on SS. Thanks Ivan.
Subject:XML with XSD to PDF Author:Adam M Date:09 Aug 2013 11:56 AM
So taking an xml and previewing is as pdf works great. A nice add would be to edit the xml the same as the XML Report. So if I have an xml with everything already in it like:
<fo:table-body>
<xsl:for-each ...
is there a way to view a complete xml as a report so you can change the layout a bit?