[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] saxon, xerces, xinclude, and DB5 (was Re: [docbook-apps]trouble using FOP to process FO file generated by Xalan or Saxon)
Dear Camille, I reported the problem on Xerces Jira some time ago, see it logged here: https://issues.apache.org/jira/browse/XERCESJ-1113 I provided also a patch in the above report that works around the problem (and that we use in oXygen to make that work). Best Regards, George --------------------------------------------------------------------- George Cristian Bina - http://aboutxml.blogspot.com/ <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com Camille Bégnis wrote: > Hi all, > > funny I'm struggling with similar issue. > > I did set up saxon to use Xerces 2.9.0 and while full inclusions like > > <xi:include href="Inserted.xml"/> > > works, referencing an id with > > <xi:include href="Inserted.xml" xpointer="para"/> > > doesn't work: > > --------------------------------------------------------------------- > Recoverable error > org.xml.sax.SAXParseException: Include operation failed, reverting to > fallback. Resource error reading file as XML (href='Inserted.xml'). > Reason: XPointer resolution unsuccessful. > Error on line 8 column 52 of file:////home/camille/test/master.xml: > Error reported by XML parser: An 'include' failed, and no 'fallback' > element was found. > Transformation failed: Failed to parse stylesheet > --------------------------------------------------------------------- > > This is with docbook 5 RNG. With Docbook 4 DTD it works. > > I suspect this is because the parser has no way to know the "xml:id" > attribute is actually of ID type, while with DocBOok 4 it has the DTD to > learn thatthe "id" attribute is an ID. > > Anyone succeeded using xinclude with xpointer="id" with DB5 RNG? > > Camille. > > > > Jeff Powanda a écrit : >> One follow-up comment about using Xerces XML parser >> (http://xerces.apache.org/xerces2-j/) with Saxon or Xalan. The latest >> version of Xerces (2.9.0) fully supports XML inclusions (XInclude), >> including XPointer syntax. > >> Regards, >> >> Jeff Powanda >> >> >> >> ------------------------------------------------------------------------ >> >> *From:* Jeff Powanda >> *Sent:* Sunday, June 10, 2007 11:14 PM >> *To:* 'fop-users@xmlgraphics.apache.org'; docbook-apps@lists.oasis-open.org >> *Subject:* RE: [docbook-apps] trouble using FOP to process FO file >> generated by Xalan or Saxon >> >> >> >> Thanks, Bob! I followed your instructions and can now process my >> documents with xsltproc, Saxon, or Xalan. I appreciate your help. >> >> >> >> Regards, >> >> Jeff Powanda >> >> >> >> ------------------------------------------------------------------------ >> >> *From:* Bob Stayton [mailto:bobs@sagehill.net] >> *Sent:* Saturday, June 09, 2007 7:36 PM >> *To:* Jeff Powanda; docbook-apps@lists.oasis-open.org; >> fop-users@xmlgraphics.apache.org >> *Subject:* Re: [docbook-apps] trouble using FOP to process FO file >> generated by Xalan or Saxon >> >> >> >> Hi Jeff, >> >> The XIncludes in your XML file are not resolving. That leaves your book >> improperly stuctured, leading to improperly structured FO output. You >> should have seen an error message from the stylesheet about not having a >> template that matches "xi:include". >> >> >> >> You need to set up either Saxon or Xalan with a recent version of Xerces >> parser and with the XInclude option turned on. See this section in my book: >> >> >> >> http://www.sagehill.net/docbookxsl/Xinclude.html#JavaXIncludes >> >> >> >> Bob Stayton >> Sagehill Enterprises >> DocBook Consulting >> bobs@sagehill.net <mailto:bobs@sagehill.net> >> >> >> >> >> >> ----- Original Message ----- >> >> *From:* Jeff Powanda <mailto:jpowanda@vocera.com> >> >> *To:* docbook-apps@lists.oasis-open.org >> <mailto:docbook-apps@lists.oasis-open.org> ; >> fop-users@xmlgraphics.apache.org >> <mailto:fop-users@xmlgraphics.apache.org> >> >> *Sent:* Saturday, June 09, 2007 5:34 PM >> >> *Subject:* [docbook-apps] trouble using FOP to process FO file >> generated by Xalan or Saxon >> >> >> >> I was using xsltproc as my XSLT processor, but it ran out of memory >> on a large book, so I decided to try Xalan and Saxon to convert a >> test book. I set up Xalan and Saxon according to the instructions in >> Bob Stayton’s book, DocBook XSL: The Definitive Guide >> (http://www.sagehill.net/docbookxsl/index.html). However, when I try >> to use FOP 0.93 to convert either of the attached FO files, it >> reports the following exception: >> >> >> >> org.xml.sax.SAXParseException: Content is not allowed in prolog. >> >> >> >> I pasted full output of the exception below. >> >> >> >> Has anyone else experienced this problem? Please take a look at the >> attached FO files and tell me what’s wrong. >> >> >> >> Regards, >> >> Jeff Powanda >> >> >> >> >> >> [Fatal Error] :1:1: Content is not allowed in prolog. >> >> Jun 9, 2007 5:21:38 PM org.apache.fop.image.analyser.XMLReader >> createDocument >> >> WARNING: Error while constructing image from XML >> >> org.xml.sax.SAXParseException: Content is not allowed in prolog. >> >> at org.apache.xerces.parsers.DOMParser.parse(Unknown Source) >> >> at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown >> Source) >> >> at >> javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:98) >> >> at >> org.apache.fop.image.analyser.XMLReader.createDocument(XMLReader.java:115) >> >> at >> org.apache.fop.image.analyser.XMLReader.loadImage(XMLReader.java:95) >> >> at >> org.apache.fop.image.analyser.XMLReader.verifySignature(XMLReader.java:65) >> >> at >> org.apache.fop.image.analyser.ImageReaderFactory.make(ImageReaderFactory.java:85) >> >> at >> org.apache.fop.image.ImageFactory.loadImage(ImageFactory.java:220) >> >> at org.apache.fop.image.ImageLoader.loadImage(ImageLoader.java:56) >> >> at >> org.apache.fop.image.ContextImageCache.getImage(ImageFactory.java:432) >> >> at >> org.apache.fop.image.ImageFactory.getImage(ImageFactory.java:157) >> >> at >> org.apache.fop.fo.flow.ExternalGraphic.bind(ExternalGraphic.java:68) >> >> at org.apache.fop.fo.FObj.processNode(FObj.java:118) >> >> at >> org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:321) >> >> at >> org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:185) >> >> at >> org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1072) >> >> at >> org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source) >> >> at >> org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(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.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:484) >> >> at >> org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:165) >> >> at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115) >> >> at org.apache.fop.cli.Main.startFOP(Main.java:160) >> >> at org.apache.fop.cli.Main.main(Main.java:191) >> >> Jun 9, 2007 5:21:38 PM org.apache.fop.image.ImageFactory loadImage >> >> SEVERE: Error while recovering image information () : null >> >> java.lang.NullPointerException >> >> at >> org.apache.fop.image.analyser.XMLReader.verifySignature(XMLReader.java:66) >> >> at >> org.apache.fop.image.analyser.ImageReaderFactory.make(ImageReaderFactory.java:85) >> >> at >> org.apache.fop.image.ImageFactory.loadImage(ImageFactory.java:220) >> >> at org.apache.fop.image.ImageLoader.loadImage(ImageLoader.java:56) >> >> at >> org.apache.fop.image.ContextImageCache.getImage(ImageFactory.java:432) >> >> at >> org.apache.fop.image.ImageFactory.getImage(ImageFactory.java:157) >> >> at >> org.apache.fop.fo.flow.ExternalGraphic.bind(ExternalGraphic.java:68) >> >> at org.apache.fop.fo.FObj.processNode(FObj.java:118) >> >> at >> org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:321) >> >> at >> org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:185) >> >> at >> org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1072) >> >> at >> org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source) >> >> at >> org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(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.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:484) >> >> at >> org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:165) >> >> at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115) >> >> at org.apache.fop.cli.Main.startFOP(Main.java:160) >> >> at org.apache.fop.cli.Main.main(Main.java:191) >> >> Jun 9, 2007 5:21:38 PM org.apache.fop.fo.flow.ExternalGraphic bind >> >> SEVERE: Image not available: url() >> >> Jun 9, 2007 5:21:39 PM org.apache.fop.cli.Main startFOP >> >> SEVERE: Exception >> >> javax.xml.transform.TransformerException: >> org.apache.fop.fo.ValidationException: >> file:///c:/docs/40SP/xml/other/indextest/IndexTest.fo:13:11234: >> Error(13/11234): fo:block is not a valid child element of fo:root. >> >> at >> org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:168) >> >> at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115) >> >> at org.apache.fop.cli.Main.startFOP(Main.java:160) >> >> at org.apache.fop.cli.Main.main(Main.java:191) >> >> >> >> --------- >> >> >> >> javax.xml.transform.TransformerException: >> org.apache.fop.fo.ValidationException: >> file:///c:/docs/40SP/xml/other/indextest/IndexTest.fo:13:11234: >> Error(13/11234): fo:block is not a valid child element of fo:root. >> >> at >> org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:501) >> >> at >> org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:165) >> >> at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115) >> >> at org.apache.fop.cli.Main.startFOP(Main.java:160) >> >> at org.apache.fop.cli.Main.main(Main.java:191) >> >> Caused by: org.apache.fop.fo.ValidationException: >> file:///c:/docs/40SP/xml/other/indextest/IndexTest.fo:13:11234: >> Error(13/11234): fo:block is not a valid child element of fo:root. >> >> at org.apache.fop.fo.FONode.invalidChildError(FONode.java:393) >> >> at org.apache.fop.fo.FONode.invalidChildError(FONode.java:378) >> >> at >> org.apache.fop.fo.pagination.Root.validateChildNode(Root.java:127) >> >> at >> org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:303) >> >> at >> org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:185) >> >> at >> org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1072) >> >> at >> org.apache.xerces.parsers.AbstractSAXParser.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.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:484) >> >> ... 4 more >> >> --------- >> >> org.apache.fop.fo.ValidationException: >> file:///c:/docs/40SP/xml/other/indextest/IndexTest.fo:13:11234: >> Error(13/11234): fo:block is not a valid child element of fo:root. >> >> at org.apache.fop.fo.FONode.invalidChildError(FONode.java:393) >> >> at org.apache.fop.fo.FONode.invalidChildError(FONode.java:378) >> >> at >> org.apache.fop.fo.pagination.Root.validateChildNode(Root.java:127) >> >> at >> org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:303) >> >> at >> org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:185) >> >> at >> org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1072) >> >> at >> org.apache.xerces.parsers.AbstractSAXParser.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.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:484) >> >> at >> org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:165) >> >> at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115) >> >> at org.apache.fop.cli.Main.startFOP(Main.java:160) >> >> at org.apache.fop.cli.Main.main(Main.java:191) >> >> >> >> >> >> ------------------------------------------------------------------------ >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org >> For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org > For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org >
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]