You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by adambomb <du...@yahoo.com> on 2008/02/20 19:10:17 UTC
SetAttributeNS compile error?
Hi everyone,
I am trying to run the sample code for Batik but I am getting all types of
compile time errors.
I have all the batik jar files in my library which include batik-svg-dom.jar
as well,
But when I try to use the method by making an object of Element class, it
throws me the compile error.
Do I need some more jar files in order to do that?
DOMImplementation impl = SVGDOMImplementation.getDOMImplementation();
String svgNS = SVGDOMImplementation.SVG_NAMESPACE_URI;
Document doc = impl.createDocument(svgNS, "svg", null);
// Get the root element (the 'svg' element).
Element svgRoot = doc.getDocumentElement();
// Set the width and height attributes on the root 'svg' element.
svgRoot.setAttributeNS(null,"width","400");.....................this is
where I get the error
svgRoot.setAttributeNS(null, "height", "450");................this is
where I get the error
So I cant get past these errors.
Could somebody help?
--
View this message in context: http://www.nabble.com/SetAttributeNS-compile-error--tp15595148p15595148.html
Sent from the Batik - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
Re: SetAttributeNS compile error?
Posted by Cameron McCormack <ca...@mcc.id.au>.
Hi.
adambomb:
> I am trying to run the sample code for Batik but I am getting all types of
> compile time errors.
> I have all the batik jar files in my library which include batik-svg-dom.jar
> as well,
> But when I try to use the method by making an object of Element class, it
> throws me the compile error.
>
> Do I need some more jar files in order to do that?
>
>
> DOMImplementation impl = SVGDOMImplementation.getDOMImplementation();
> String svgNS = SVGDOMImplementation.SVG_NAMESPACE_URI;
> Document doc = impl.createDocument(svgNS, "svg", null);
>
> // Get the root element (the 'svg' element).
> Element svgRoot = doc.getDocumentElement();
>
> // Set the width and height attributes on the root 'svg' element.
> svgRoot.setAttributeNS(null,"width","400");.....................this is
> where I get the error
> svgRoot.setAttributeNS(null, "height", "450");................this is
> where I get the error
Those lines look OK to me, and any barely-recent JRE will include the
DOM Level 2 org.w3c.dom.Element interface. Can you post you exact
compilation error messages?
Cameron
--
Cameron McCormack, http://mcc.id.au/
xmpp:heycam@jabber.org ▪ ICQ 26955922 ▪ MSN cam@mcc.id.au
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org