Newbie: Problems with SVG

Discussion in 'XML' started by =?ISO-8859-1?Q?Michael_Br=E4uer?=, Oct 28, 2003.

  1. Hi,

    I'm a Newbie in using FOP. I wrote some simple XSL-FO Files and created
    some nice PDFs. Now I want to embed a SVG in the XSL-FO file.
    My XSL-FO:
    <fo:instream-foreign-object>
    <svg width="150" height="150" xmlns="http://www.w3.org/2000/svg">
    <polygon points="10,10 50,50 100,10" stroke="red"
    stroke-width="2"/>
    </svg>
    </fo:instream-foreign-object>

    FOP stops with the following message:
    Exception in thread "main" java.lang.NoSuchMethodError:
    org.apache.batik.dom.AbstractAttr: method isReadonly()Z not found
    atorg.apache.batik.dom.AbstractAttr.setNodeValue(AbstractAttr.java,
    Compiled Code)
    at
    org.apache.batik.dom.AbstractAttr.setValue(AbstractAttr.java:177)
    at
    org.apache.batik.dom.svg.AbstractElement$ExtendedNamedNodeHashMap.setUnspecifiedAttribute(AbstractElement.java:238)
    at
    org.apache.batik.dom.svg.AbstractElement.setUnspecifiedAttribute(AbstractElement.java:149)
    at
    org.apache.batik.dom.svg.AttributeInitializer.resetAttribute(AttributeInitializer.java:94)
    at
    org.apache.batik.dom.svg.AttributeInitializer.initializeAttributes(AttributeInitializer.java,
    Compiled Code)
    at
    org.apache.batik.dom.svg.AbstractElement.initializeAttributes(AbstractElement.java:115)
    at
    org.apache.batik.dom.svg.AbstractElement.<init>(AbstractElement.java:59)
    at
    org.apache.batik.dom.svg.SVGOMElement.<init>(SVGOMElement.java:72)
    at
    org.apache.batik.dom.svg.SVGStylableElement.<init>(SVGStylableElement.java:70)
    at
    org.apache.batik.dom.svg.SVGOMSVGElement.<init>(SVGOMSVGElement.java:103)
    at
    org.apache.batik.dom.svg.SVGDOMImplementation$SvgElementFactory.create(SVGDOMImplementation.java:1508)
    at
    org.apache.batik.dom.svg.SVGDOMImplementation.createElementNS(SVGDOMImplementation.java:255)
    at
    org.apache.batik.dom.svg.SVGOMDocument.createElementNS(SVGOMDocument.java:338)
    at
    org.apache.batik.dom.svg.SVGDOMImplementation.createDocument(SVGDOMImplementation.java:175)
    at org.apache.fop.svg.SVGElement.init(SVGElement.java:255)
    at org.apache.fop.svg.SVGElement.<init>(SVGElement.java:120)
    at
    org.apache.fop.svg.SVGElement$Maker.make(SVGElement.java:95)
    at
    org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:352)
    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.DTDConfiguration.parse(Unknown
    Source)
    at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown
    Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
    Source)
    at org.apache.fop.apps.Driver.render(Driver.java:498)
    at
    org.apache.fop.apps.CommandLineStarter.run(CommandLineStarter.java:106)
    at org.apache.fop.apps.Fop.main(Fop.java:62)

    With other graphics like gif or jpeg it worked well. So I think the
    problem is the SVG.

    My System: WINNT 4.0 (SP6), FOP0.20.5, JDK1.4

    I think the Classpath in the fop.bat is correct:
    @ECHO OFF

    rem %~dp0 is the expanded pathname of the current script under NT
    set LOCAL_FOP_HOME=
    if "%OS%"=="Windows_NT" set LOCAL_FOP_HOME=%~dp0

    set LIBDIR=%LOCAL_FOP_HOME%lib
    set LOCALCLASSPATH=%LOCAL_FOP_HOME%build\fop.jar
    set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xml-apis.jar
    set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xercesImpl-2.2.1.jar
    set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xalan-2.4.1.jar
    set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\batik.jar
    set
    LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\avalon-framework-cvs-20020806.jar
    set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\jimi-1.0.jar
    set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\jai_core.jar
    set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\jai_codec.jar
    java -cp "%LOCALCLASSPATH%" org.apache.fop.apps.Fop %1 %2 %3 %4 %5 %6
    %7 %8

    I tried to install an other version of batik, or the JRE, but it didn't
    work.

    I hope someone has an idea, I'm a Newbie with Java, too, so it's very
    hard for me to follow the discussion on this board.

    Hopefully
    Michael Braeuer
    =?ISO-8859-1?Q?Michael_Br=E4uer?=, Oct 28, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Arne Nordmann
    Replies:
    0
    Views:
    511
    Arne Nordmann
    Jun 28, 2004
  2. Mardagg
    Replies:
    0
    Views:
    793
    Mardagg
    May 12, 2006
  3. Mardagg
    Replies:
    0
    Views:
    644
    Mardagg
    May 12, 2006
  4. milof83

    svg to svg saving problem

    milof83, Aug 18, 2006, in forum: Java
    Replies:
    1
    Views:
    806
    Roland de Ruiter
    Aug 18, 2006
  5. Helmut Jarausch

    Re: svg-chart 1.1 SVG Charting Library

    Helmut Jarausch, May 20, 2008, in forum: Python
    Replies:
    0
    Views:
    461
    Helmut Jarausch
    May 20, 2008
Loading...

Share This Page