Home » Developer & Programmer » Application Express, ORDS & MOD_PLSQL » Trouble using Tomcat, Cocoon and FODesigner (Windows)
Trouble using Tomcat, Cocoon and FODesigner [message #421888] Fri, 11 September 2009 07:38 Go to next message
moombaroo
Messages: 2
Registered: September 2009
Junior Member
I am using the set up Tomcat and Cocoon as a FOP server. I have set up APEX to point to the FOP server. The using the "Generic Report Layout" that APEX creates or using copies of Generic Report Layout, reports are produced just fine.

I also have obtained the FODesigner tool written by Java4Less.

I am having problems designing and writing my own reports using FODesigner and APEX. The steps and problems are as follows:

1) I write a query in APEX.
Home>Application Builder>Application 502>Shared Components>Report Queries>Edit Report Query.
select * from gender_type

2) Export the XML and XML Schema from APEX.
XML File
<?xml version="1.0" encoding="UTF-8"?>
<DOCUMENT>
<DATE>10-SEP-09</DATE>
<USER_NAME>DHARTMAN</USER_NAME>
<APP_ID>502</APP_ID>
<APP_NAME>APEX - Application Builder</APP_NAME>
<TITLE>example</TITLE>
<REGION ID="0">
<ROWSET>
<ROW>
<GNDR_TYP_CD>male</GNDR_TYP_CD>
<GNDR_TYP_NM>Male</GNDR_TYP_NM>
<GNDR_TYP_NCCI_CD>1</GNDR_TYP_NCCI_CD>
<GNDR_TYP_VOID_IND>n</GNDR_TYP_VOID_IND>
<PCT_AUDT_USER_CREA>PCT</PCT_AUDT_USER_CREA>
<PCT_AUDT_DTM>06-OCT-08 10.01.45.000000 AM</PCT_AUDT_DTM>
<PCT_PK_ID>13359</PCT_PK_ID>
</ROW>
<ROW>
<GNDR_TYP_CD>fem</GNDR_TYP_CD>
<GNDR_TYP_NM>Female</GNDR_TYP_NM>
<GNDR_TYP_NCCI_CD>2</GNDR_TYP_NCCI_CD>
<GNDR_TYP_VOID_IND>n</GNDR_TYP_VOID_IND>
<PCT_AUDT_USER_CREA>PCT</PCT_AUDT_USER_CREA>
<PCT_AUDT_DTM>06-OCT-08 10.01.45.000000 AM</PCT_AUDT_DTM>
<PCT_PK_ID>13360</PCT_PK_ID>
</ROW>
<ROW>
<GNDR_TYP_CD>unk</GNDR_TYP_CD>
<GNDR_TYP_NM>Unknown</GNDR_TYP_NM>
<GNDR_TYP_NCCI_CD>3</GNDR_TYP_NCCI_CD>
<GNDR_TYP_VOID_IND>n</GNDR_TYP_VOID_IND>
<PCT_AUDT_USER_CREA>PCT</PCT_AUDT_USER_CREA>
<PCT_AUDT_DTM>06-OCT-08 10.01.45.000000 AM</PCT_AUDT_DTM>
<PCT_PK_ID>13361</PCT_PK_ID>
</ROW>
</ROWSET>
</REGION>
</DOCUMENT>
XML Schema File
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="Link Removed">
<xs:element name="DOCUMENT">
<xs:complexType>
<xs:sequence>
<xs:element ref="DATE"/>
<xs:element ref="USER_NAME"/>
<xs:element ref="APP_ID"/>
<xs:element ref="APP_NAME"/>
<xs:element ref="TITLE"/>
<xs:element ref="REGION"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="DATE">
<xs:simpleType>
<xs:restriction base="xs:string"/>
</xs:simpleType>
</xs:element>
<xs:element name="USER_NAME">
<xs:simpleType>
<xs:restriction base="xs:string"/>
</xs:simpleType>
</xs:element>
<xs:element name="APP_ID">
<xs:simpleType>
<xs:restriction base="xs:string"/>
</xs:simpleType>
</xs:element>
<xs:element name="APP_NAME">
<xs:simpleType>
<xs:restriction base="xs:string"/>
</xs:simpleType>
</xs:element>
<xs:element name="TITLE">
<xs:simpleType>
<xs:restriction base="xs:string"/>
</xs:simpleType>
</xs:element>
<xs:element name="REGION">
<xs:complexType>
<xs:sequence>
<xs:element ref="ROWSET"/>
</xs:sequence>
<xs:attribute name="ID" use="required">
<xs:simpleType>
<xs:restriction base="xs:byte">
<xs:enumeration value="0"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="ROWSET">
<xs:complexType>
<xs:sequence>
<xs:element ref="ROW"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ROW">
<xs:complexType>
<xs:sequence>
<xs:element name="GNDR_TYP_CD">
<xs:simpleType>
<xs:restriction base="xs:string"/>
</xs:simpleType>
</xs:element>
<xs:element name="GNDR_TYP_NM">
<xs:simpleType>
<xs:restriction base="xs:string"/>
</xs:simpleType>
</xs:element>
<xs:element name="GNDR_TYP_NCCI_CD">
<xs:simpleType>
<xs:restriction base="xs:string"/>
</xs:simpleType>
</xs:element>
<xs:element name="GNDR_TYP_VOID_IND">
<xs:simpleType>
<xs:restriction base="xs:string"/>
</xs:simpleType>
</xs:element>
<xs:element name="PCT_AUDT_USER_CREA">
<xs:simpleType>
<xs:restriction base="xs:string"/>
</xs:simpleType>
</xs:element>
<xs:element name="PCT_AUDT_DTM">
<xs:simpleType>
<xs:restriction base="xs:string"/>
</xs:simpleType>
</xs:element>
<xs:element name="PCT_PK_ID">
<xs:simpleType>
<xs:restriction base="xs:string"/>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

3) Open the XML and XML Schema in the FODesigner tool

4) Create a report format in FODesigner.

5) Export the xsl-fo file from FODesigner.
XML Schema File
<?xml version="1.0" encoding="UTF-8"?><xsl:transform version="1.0" xmlns:xsl="Link Removed" xmlns:j4lext="Link Removed" extension-element-prefixes="j4lext" >
<xsl:template match="/"><fo:root xmlns:fo="Link Removed">
<fo:layout-master-set>
<fo:simple-page-master master-name="master1" page-width="21.0cm" page-height="29.7cm" margin-top="2.0cm" margin-bottom="2.0cm" margin-left="2.0cm" margin-right="2.0cm" >
<fo:region-body margin-top="0.24cm"/>
<fo:region-before extent="0.24cm"/>
<fo:region-after extent="0.49cm"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="master1">
<fo:static-content flow-name="xsl-region-before">
<fo:table width="17.0cm" >
<fo:table-column column-width="17.0cm"/>
<fo:table-body>
<fo:table-row background-color="#ffffff" height="0.24cm">
<fo:table-cell><fo:table>
<fo:table-column column-width="17.0cm"/>
<fo:table-body>
<fo:table-row background-color="#ffffff" height="0.24cm">
<fo:table-cell number-columns-spanned="1">
<fo:block></fo:block> </fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table></fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:static-content>
<fo:static-content flow-name="xsl-region-after">
<fo:table width="17.0cm" >
<fo:table-column column-width="17.0cm"/>
<fo:table-body>
<fo:table-row background-color="#ffffff" height="0.49cm">
<fo:table-cell><fo:table>
<fo:table-column column-width="17.0cm"/>
<fo:table-body>
<fo:table-row background-color="#ffffff" height="0.49cm">
<fo:table-cell number-columns-spanned="1">
<fo:block></fo:block> </fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table></fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">

<!-- START Area Header -->
<xsl:if test="count(DOCUMENT/REGION) &gt; 0" >
<xsl:for-each select="DOCUMENT/REGION">
<fo:table width="17.0cm" >
<fo:table-column column-width="17.0cm"/>
<fo:table-body>
<fo:table-row background-color="#ffffff" height="0.43cm">
<fo:table-cell><fo:table>
<fo:table-column column-width="17.0cm"/>
<fo:table-body>
<fo:table-row background-color="#ffffff" height="0.43cm">
<fo:table-cell number-columns-spanned="1">
<fo:block></fo:block> </fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table></fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell number-columns-spanned="1">
<fo:block>

<!-- START Area Detail -->
<xsl:if test="count(ROWSET/ROW) &gt; 0" >
<fo:table width="17.0cm" >
<fo:table-column column-width="17.0cm"/>
<fo:table-header>
<fo:table-row background-color="#ffffff" height="0.22cm">
<fo:table-cell><fo:table>
<fo:table-column column-width="17.0cm"/>
<fo:table-body>
<fo:table-row background-color="#ffffff" height="0.22cm">
<fo:table-cell number-columns-spanned="1">
<fo:block></fo:block> </fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table></fo:table-cell>
</fo:table-row>
</fo:table-header>
<fo:table-body>
<xsl:for-each select="ROWSET/ROW">
<fo:table-row background-color="#ffffff" height="1.3cm">
<fo:table-cell><fo:table>
<fo:table-column column-width="2.0cm"/>
<fo:table-column column-width="15.0cm"/>
<fo:table-body>
<fo:table-row background-color="#ffffff" height="1.3cm">
<fo:table-cell number-columns-spanned="1">
<fo:block margin-left="0.0cm" margin-right="0.65cm" margin-top="0.0cm" font-size="10pt" font-family="SansSerif" color="#000000" text-align="left"><xsl:value-of select="GNDR_TYP_CD"></xsl:value-of></fo:block>
</fo:table-cell>
<fo:table-cell number-columns-spanned="1">
<fo:block margin-left="0.0cm" margin-right="12.76cm" margin-top="0.0cm" font-size="10pt" font-family="SansSerif" color="#000000" text-align="left"><xsl:value-of select="GNDR_TYP_NM"></xsl:value-of></fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table></fo:table-cell>
</fo:table-row>
</xsl:for-each>
</fo:table-body>
</fo:table>
</xsl:if>

<!-- END Area Detail -->
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell number-columns-spanned="1">
<fo:block>

<!-- START Area Footer -->
<fo:table width="17.0cm" >
<fo:table-column column-width="17.0cm"/>
<fo:table-body>
<fo:table-row background-color="#ffffff" height="0.32cm">
<fo:table-cell><fo:table>
<fo:table-column column-width="17.0cm"/>
<fo:table-body>
<fo:table-row background-color="#ffffff" height="0.32cm">
<fo:table-cell number-columns-spanned="1">
<fo:block></fo:block> </fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table></fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>

<!-- END Area Footer -->
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</xsl:for-each>
</xsl:if>

<!-- END Area Header -->
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>
</xsl:transform>

6) Import the xsl-fo into APEX.
Home>Application Builder>Application 502>Shared Components>Report Layouts>Edit Report Layout

7) Test Report in APEX.
Home>Application Builder>Application 502>Shared Components>Report Queries>Edit Report Query

8) When I open the PDF or RTF file I get the following message:
<pre id="stacktrace">org.xml.sax.SAXParseException: XML document structures must start and end within the same entity.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.endEntity(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl.endEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.endEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)
at org.apache.xerces.impl.XMLEntityScanner.scanLiteral(Unknown Source)
at org.apache.xerces.impl.XMLScanner.scanAttributeValue(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanAttribute(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.apache.excalibur.xml.impl.JaxpParser.parse(JaxpParser.java:315)
at org.apache.excalibur.xml.impl.JaxpParser.parse(JaxpParser.java:334)
at org.apache.cocoon.generation.StreamGenerator.generate(StreamGenerator.java:154)
at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.processXMLPipeline(AbstractProcessingPipeline.java:579)
at org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline.processXMLPipeline(AbstractCachingProcessingPipeline.jav a:280)
at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process(AbstractProcessingPipeline.java:780)
at org.apache.cocoon.components.source.impl.SitemapSource.toSAX(SitemapSource.java:414)
at org.apache.cocoon.components.xslt.TraxProcessor.sourceToSAX(TraxProcessor.java:306)
at org.apache.cocoon.components.xslt.TraxProcessor.getTransformerHandlerAndValidity(TraxProcessor.java:241)
at org.apache.cocoon.transformation.TraxTransformer.setup(TraxTransformer.java:331)
at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.setupPipeline(AbstractProcessingPipeline.java:398)
at org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline.setupPipeline(AbstractCachingProcessingPipeline.java:718 )
at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.preparePipeline(AbstractProcessingPipeline.java:501)
at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process(AbstractProcessingPipeline.java:453)
at org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invoke(SerializeNode.java:144)
at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:69)
at org.apache.cocoon.components.treeprocessor.sitemap.SwitchSelectNode.invoke(SwitchSelectNode.java:104)
at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:47)
at org.apache.cocoon.components.treeprocessor.sitemap.MatchNode.invoke(MatchNode.java:108)
at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:69)
at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:143)
at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:69)
at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:93)
at org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:235)
at org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:177)
at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:254)
at org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(MountNode.java:118)
at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:47)
at org.apache.cocoon.components.treeprocessor.sitemap.MatchNode.invoke(MatchNode.java:108)
at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:69)
at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:143)
at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:69)
at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:93)
at org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:235)
at org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:177)
at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:254)
at org.apache.cocoon.Cocoon.process(Cocoon.java:699)
at org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1154)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Thread.java:595)



I have tried producing various different reports and they all get this messages.

What is this trying to tell me?
Which file has the problem?
The XML datafile, XML schema file or the XSL-FO layout file?
What exactly is the problem?
What does XML "document structures must start and end within the same entity" mean?

p.s. I had to remove all URL links to post on this site





Re: Trouble using Tomcat, Cocoon and FODesigner [message #421913 is a reply to message #421888] Fri, 11 September 2009 11:46 Go to previous message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
Try searching http://forums.oracle.com/forums/forum.jspa?forumID=137 it's the most active Apex forum.
Previous Topic: Rows per Page Selector (Interactive Report)
Next Topic: 2 Forms on a single page
Goto Forum:
  


Current Time: Thu Mar 28 09:14:34 CDT 2024