Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Newbie: Problems with SVG

Reply
Thread Tools

Newbie: Problems with SVG

 
 
=?ISO-8859-1?Q?Michael_Br=E4uer?=
Guest
Posts: n/a
 
      10-28-2003
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(A bstractAttr.java,
Compiled Code)
at
org.apache.batik.dom.AbstractAttr.setValue(Abstrac tAttr.java:177)
at
org.apache.batik.dom.svg.AbstractElement$ExtendedN amedNodeHashMap.setUnspecifiedAttribute(AbstractEl ement.java:23
at
org.apache.batik.dom.svg.AbstractElement.setUnspec ifiedAttribute(AbstractElement.java:149)
at
org.apache.batik.dom.svg.AttributeInitializer.rese tAttribute(AttributeInitializer.java:94)
at
org.apache.batik.dom.svg.AttributeInitializer.init ializeAttributes(AttributeInitializer.java,
Compiled Code)
at
org.apache.batik.dom.svg.AbstractElement.initializ eAttributes(AbstractElement.java:115)
at
org.apache.batik.dom.svg.AbstractElement.<init>(Ab stractElement.java:59)
at
org.apache.batik.dom.svg.SVGOMElement.<init>(SVGOM Element.java:72)
at
org.apache.batik.dom.svg.SVGStylableElement.<init> (SVGStylableElement.java:70)
at
org.apache.batik.dom.svg.SVGOMSVGElement.<init>(SV GOMSVGElement.java:103)
at
org.apache.batik.dom.svg.SVGDOMImplementation$SvgE lementFactory.create(SVGDOMImplementation.java:150
at
org.apache.batik.dom.svg.SVGDOMImplementation.crea teElementNS(SVGDOMImplementation.java:255)
at
org.apache.batik.dom.svg.SVGOMDocument.createEleme ntNS(SVGOMDocument.java:33
at
org.apache.batik.dom.svg.SVGDOMImplementation.crea teDocument(SVGDOMImplementation.java:175)
at org.apache.fop.svg.SVGElement.init(SVGElement.java :255)
at org.apache.fop.svg.SVGElement.<init>(SVGElement.ja va:120)
at
org.apache.fop.svg.SVGElement$Maker.make(SVGElemen t.java:95)
at
org.apache.fop.fo.FOTreeBuilder.startElement(FOTre eBuilder.java:352)
at
org.apache.xerces.parsers.AbstractSAXParser.startE lement(Unknown
Source)
at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.sc anStartElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl.scanDocument(Unknown
Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(U nknown
Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(U nknown
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:49
at
org.apache.fop.apps.CommandLineStarter.run(Command LineStarter.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%\xercesImp l-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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: svg-chart 1.1 SVG Charting Library Helmut Jarausch Python 0 05-20-2008 11:05 AM
svg to svg saving problem milof83 Java 1 08-18-2006 07:36 PM
[SVG] probleme dessin d'images SVG avec Batik Mardagg Java 0 05-12-2006 02:13 PM
[SVG] problem with SVG image drawing with Batik Library Mardagg Java 0 05-12-2006 02:12 PM
[SVG] using image-tag to integrate SVG in SVG Arne Nordmann XML 0 06-28-2004 01:16 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57