Hi,
I would like to use the flowing text abilities of SVG1.2 with FOP but i
can't get FOP to "switch" to SVG1.2 mode and i get this error:

GRAVE: Exception
org.w3c.dom.DOMException: The current document is unable to create an
element of the requested type (namespace: http://www.w3.org/2000/svg, name:
flowRoot).
        at
org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:217)
        at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:125)
        at org.apache.fop.cli.Main.startFOP(Main.java:166)
        at org.apache.fop.cli.Main.main(Main.java:197)

---------

org.w3c.dom.DOMException: The current document is unable to create an
element of the requested type (namespace: http://www.w3.org/2000/svg, name:
flowRoot).
        at org.apache.batik.dom.AbstractNode.createDOMException(Unknown
Source)
        at
org.apache.batik.dom.svg.SVGDOMImplementation.createElementNS(Unknown
Source)
        at org.apache.batik.dom.svg.SVGOMDocument.createElementNS(Unknown
Source)
        at org.apache.xml.utils.DOMBuilder.startElement(DOMBuilder.java:324)
        at
org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1072)
        at
org.apache.fop.util.DelegatingContentHandler.startElement(DelegatingContentHandler.java:182)
        at
org.apache.fop.util.DOMBuilderContentHandlerFactory$Handler.startElement(DOMBuilderContentHandlerFactory.java:124)
        at
org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:163)
        at
org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1072)
        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
org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:484)
        at
org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:214)
        at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:125)
        at org.apache.fop.cli.Main.startFOP(Main.java:166)
        at org.apache.fop.cli.Main.main(Main.java:197)


I found a thread in the archives which is exactly what i'm trying to do:
http://fop-users.markmail.org/search/?q=flowroot#query:flowroot+page:1+mid:h2oak7zhcds6tvje+state:results

Unfortunately, the answer given by Jeremias (writing version="1.2" in the
svg root tag) didn't help.
Here is the .fo file (the svg part comes from the W3C):


<?xml version="1.0" encoding="utf-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format";>
    <fo:layout-master-set>
        <fo:simple-page-master margin-bottom="10mm" margin-top="10mm"
        margin-right="10mm" margin-left="10mm" page-width="210mm"
        page-height="297mm" master-name="A4-portrait">
            <fo:region-body margin-bottom="10mm" margin-top="10mm" />
        </fo:simple-page-master>
    </fo:layout-master-set>
    <fo:page-sequence font-size="10pt" font-family="times"
master-reference="A4-portrait">
    <fo:flow flow-name="xsl-region-body">
      <fo:block>
        <fo:instream-foreign-object>
            <svg xmlns="http://www.w3.org/2000/svg"; version="1.2"
width="100mm" height="150mm">
                <flowRoot font-size="16">
                    <flowRegion>
                        <path d="M100,50L50,300L250,300L300,50z"/>
                    </flowRegion>
                    <flowPara>Tomorrow, and tomorrow, and tomorrow; creeps
in this
                       petty pace from day to day, until the last syllable
of recorded time.
                       And all our yesterdays have lighted fools the way to
dusty death.
                    </flowPara>
                </flowRoot>
            </svg>
        </fo:instream-foreign-object>
      </fo:block>
    </fo:flow>
  </fo:page-sequence>
</fo:root>

However, when i use fo:external-graphic to include the same svg, it "works",
or maybe should i say it doesn't crash... The PDF rendering is working, but
the result is just a black parallelogram instead of the text (exactly the
same result as in Firefox 3 for instance). There is only InkScape which
renders the svg correctly.
What am I missing here ?

Thanks for your help ;)

Reply via email to