Format <remark> in red text in PDF
Posted: Tue Jul 16, 2013 6:28 am
Hi Sorin & Radu,
We have two PDF transforms: Draft and Final.
The Draft transform has draft.mode=yes and show.comments=1.
I want text enclosed in <remark> elements to display in red text, so I copied the code from inline.xsl (lines 1207-1213), added to our custom fo.xsl layer, and added the red color attribute:
Tested it Friday and it was working fine. Remarks displayed in red text in our Draft PDFs and no remarks displayed in our Final PDFs. I have draft PDFs from Friday and Sunday with the red remark text.
Today it suddenly stopped working and I get the following error.
It's definitely an error caused by the red text customization, because when I comment out that code, I can create a PDF again, with remarks formatted in italic black text.
We have two PDF transforms: Draft and Final.
The Draft transform has draft.mode=yes and show.comments=1.
I want text enclosed in <remark> elements to display in red text, so I copied the code from inline.xsl (lines 1207-1213), added to our custom fo.xsl layer, and added the red color attribute:
Code: Select all
</xsl:template>
<xsl:template match="d:comment|d:remark">
<xsl:if test="$show.comments != 0">
<fo:inline font-style="italic" color="red">
<xsl:call-template name="inline.charseq"/>
</fo:inline>
</xsl:if>
</xsl:template>
Today it suddenly stopped working and I get the following error.
It's definitely an error caused by the red text customization, because when I comment out that code, I can create a PDF again, with remarks formatted in italic black text.
System ID: C:\00_book_files\depot\main\p4-doc\manuals\p4-git-fusion-admin\xml\p4gf_xibook.xml_xslt
Scenario: 1_Draft PDF: old duplicate July 15 test
XML file: C:\00_book_files\depot\main\p4-doc\manuals\p4-git-fusion-admin\xml\p4gf_xibook.xml
XSL file: C:\Program Files\Oxygen XML Editor 142\frameworks\docbook\xsl\fo\p4-fo.xsl
Engine name: Apache FOP
Severity: error
Description: The process 'Apache FOP' ended with code: 1.
The error was:
ERROR - Image not found. URI: images/draft.png. (See position 1:-1)
ERROR - Image not found. URI: images/draft.png. (See position 1:-1)
ERROR - Image not found. URI: images/draft.png. (See position 1:-1)
ERROR - Image not found. URI: images/draft.png. (See position 1:-1)
ERROR - Image not found. URI: images/draft.png. (See position 1:-1)
ERROR - Image not found. URI: images/draft.png. (See position 1:-1)
ERROR - Image not found. URI: images/draft.png. (See position 1:-1)
ERROR - Image not found. URI: images/draft.png. (See position 1:-1)
ERROR - Image not found. URI: images/draft.png. (See position 1:-1)
ERROR - Image not found. URI: images/draft.png. (See position 1:-1)
ERROR - Image not found. URI: images/draft.png. (See position 1:-1)
ERROR - Image not found. URI: images/draft.png. (See position 1:-1)
ERROR - Image not found. URI: images/draft.png. (See position 1:-1)
ERROR - Image not found. URI: images/draft.png. (See position 1:-1)
ERROR - Image not found. URI: images/draft.png. (See position 1:-1)
ERROR - Image not found. URI: images/draft.png. (See position 1:-1)
ERROR - Image not found. URI: images/draft.png. (See position 1:-1)
ERROR - Image not found. URI: images/draft.png. (See position 1:-1)
ERROR - Image not found. URI: images/draft.png. (See position 1:-1)
ERROR - Image not found. URI: perforce-logo.svg. (See position 2:-1)
ERROR - Couldn't find hyphenation pattern for lang="en".
ERROR - Image not found. URI: perforce-logo.svg. (No context info available)
ERROR - Exception
net.sf.saxon.trans.XPathException: org.apache.fop.fo.ValidationException: "fo:inline" is not a valid child of "fo:flow"! (See position 2074:-1)
at org.apache.fop.cli.InputHandlerFOP.transformTo(Unknown Source)
at org.apache.fop.cli.InputHandlerFOP.renderTo(Unknown Source)
at org.apache.fop.cli.Main.startFOP(Main.java:177)
at org.apache.fop.cli.Main.main(Main.java:208)
Caused by: net.sf.saxon.trans.XPathException: org.apache.fop.fo.ValidationException: "fo:inline" is not a valid child of "fo:flow"! (See position 2074:-1)
at net.sf.saxon.event.ContentHandlerProxy.handleSAXException(Unknown Source)
at net.sf.saxon.event.ContentHandlerProxy.startContent(Unknown Source)
at net.sf.saxon.event.NamespaceReducer.startContent(NamespaceReducer.java:192)
at net.sf.saxon.event.ReceivingContentHandler.startElement(ReceivingContentHandler.java:344)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
at org.apache.xerces.xinclude.XIncludeHandler.startElement(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 net.sf.saxon.event.Sender.sendSAXSource(Sender.java:405)
at net.sf.saxon.event.Sender.send(Sender.java:152)
at net.sf.saxon.IdentityTransformer.transform(IdentityTransformer.java:39)
... 4 more
Caused by: org.apache.fop.fo.ValidationException: "fo:inline" is not a valid child of "fo:flow"! (See position 2074:-1)
at org.apache.fop.events.ValidationExceptionFactory.createException(ValidationExceptionFactory.java:38)
at org.apache.fop.events.EventExceptionManager.throwException(EventExceptionManager.java:58)
at org.apache.fop.events.DefaultEventBroadcaster$1.invoke(DefaultEventBroadcaster.java:175)
at $Proxy7.invalidChild(Unknown Source)
at org.apache.fop.fo.FONode.invalidChildError(FONode.java:561)
at org.apache.fop.fo.FONode.invalidChildError(FONode.java:537)
at org.apache.fop.fo.pagination.Flow.validateChildNode(Flow.java:107)
at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:265)
at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:175)
... 20 more
---------
net.sf.saxon.trans.XPathException: org.apache.fop.fo.ValidationException: "fo:inline" is not a valid child of "fo:flow"! (See position 2074:-1)
at net.sf.saxon.event.ContentHandlerProxy.handleSAXException(Unknown Source)
at net.sf.saxon.event.ContentHandlerProxy.startContent(Unknown Source)
at net.sf.saxon.event.NamespaceReducer.startContent(NamespaceReducer.java:192)
at net.sf.saxon.event.ReceivingContentHandler.startElement(ReceivingContentHandler.java:344)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
at org.apache.xerces.xinclude.XIncludeHandler.startElement(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 net.sf.saxon.event.Sender.sendSAXSource(Sender.java:405)
at net.sf.saxon.event.Sender.send(Sender.java:152)
at net.sf.saxon.IdentityTransformer.transform(IdentityTransformer.java:39)
at org.apache.fop.cli.InputHandlerFOP.transformTo(Unknown Source)
at org.apache.fop.cli.InputHandlerFOP.renderTo(Unknown Source)
at org.apache.fop.cli.Main.startFOP(Main.java:177)
at org.apache.fop.cli.Main.main(Main.java:208)
Caused by: org.apache.fop.fo.ValidationException: "fo:inline" is not a valid child of "fo:flow"! (See position 2074:-1)
at org.apache.fop.events.ValidationExceptionFactory.createException(ValidationExceptionFactory.java:38)
at org.apache.fop.events.EventExceptionManager.throwException(EventExceptionManager.java:58)
at org.apache.fop.events.DefaultEventBroadcaster$1.invoke(DefaultEventBroadcaster.java:175)
at $Proxy7.invalidChild(Unknown Source)
at org.apache.fop.fo.FONode.invalidChildError(FONode.java:561)
at org.apache.fop.fo.FONode.invalidChildError(FONode.java:537)
at org.apache.fop.fo.pagination.Flow.validateChildNode(Flow.java:107)
at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:265)
at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:175)
... 20 more
---------
org.apache.fop.fo.ValidationException: "fo:inline" is not a valid child of "fo:flow"! (See position 2074:-1)
at org.apache.fop.events.ValidationExceptionFactory.createException(ValidationExceptionFactory.java:38)
at org.apache.fop.events.EventExceptionManager.throwException(EventExceptionManager.java:58)
at org.apache.fop.events.DefaultEventBroadcaster$1.invoke(DefaultEventBroadcaster.java:175)
at $Proxy7.invalidChild(Unknown Source)
at org.apache.fop.fo.FONode.invalidChildError(FONode.java:561)
at org.apache.fop.fo.FONode.invalidChildError(FONode.java:537)
at org.apache.fop.fo.pagination.Flow.validateChildNode(Flow.java:107)
at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:265)
at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:175)
at net.sf.saxon.event.ContentHandlerProxy.startContent(Unknown Source)
at net.sf.saxon.event.NamespaceReducer.startContent(NamespaceReducer.java:192)
at net.sf.saxon.event.ReceivingContentHandler.startElement(ReceivingContentHandler.java:344)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
at org.apache.xerces.xinclude.XIncludeHandler.startElement(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 net.sf.saxon.event.Sender.sendSAXSource(Sender.java:405)
at net.sf.saxon.event.Sender.send(Sender.java:152)
at net.sf.saxon.IdentityTransformer.transform(IdentityTransformer.java:39)
at org.apache.fop.cli.InputHandlerFOP.transformTo(Unknown Source)
at org.apache.fop.cli.InputHandlerFOP.renderTo(Unknown Source)
at org.apache.fop.cli.Main.startFOP(Main.java:177)
at org.apache.fop.cli.Main.main(Main.java:208)
Start location: 1:0