RE: Dom manipulation
Martin Gainty <[email protected]> Fri, 31 May 2013 06:06:14 -0400
| Newsgroups | gmane.text.xml.batik.user |
|---|---|
| Message-ID | <[email protected]> |
Hello,
I am a new user trying modify an SVG file and then render it as a JPEG.
I convert the SVG file into a w3c Document.then I get the element that I need to update.
but when I try to update the text in that element I get the following error:
java.lang.AbstractMethodError: org.apache.batik.dom.svg.SVGOMTextElement.getTextContent()Ljava/lang/String;
My code is as follows:
final String parser = XMLResourceDescriptor.getXMLParserClassName();final SAXSVGDocumentFactory svgDocFactory = new SAXSVGDocumentFactory(parser);
svgDoc = svgDocFactory.createDocument(svgUri);final Element element = svgDoc.getElementById("MainTitle");
MG> should be SVGOMTextElement not Base Class Element
System.out.println("Element Text:" + element.getTextContent().toString());
MG>getTextContent is already returning String why are you doing a toString() again?
Please help me how to update values of elements in the SVG Dom document.
I will be glad if you can point me to a link where I can get samples or documentation of using the DOM api.
Thanking You,--
Regards,Ouch Whisper010101010101
MG>it would be a good idea to send us the maven pom.xml you are using to build with
MG>at least that way we can easily determine the versions of dependencies you are using to build with
MG>using ant or any other build tool that is version-unaware and will lead you down a path where there is no recovery