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 "Bishop, Michael W. CONTR J9C880" <Mi...@je.jfcom.mil> on 2005/12/02 18:29:35 UTC

RE: Error importing Images into an image tag?

OK, maybe not so fine.  This is odd.
 
if I use:
element.setAttributeNS(
            XLINK_NAMESPACE_URI, SVGConstants.SVG_HREF_ATTRIBUTE, imageName);
 
The image is placed on the canvas just fine, but I get the same error message about "xlink:href" missing when I load the document later.
 
If I use:
element.setAttributeNS(
            XLINK_NAMESPACE_URI, "xlink:href", imageName);
 
I get the "xlink:href" error when I place the Image, but it works fine when I load the document later.
 
What gives?
 
public static final String XLINK_NAMESPACE_URI =
        "http://www.w3.org/1999/xlink";
 
Michael Bishop
 

________________________________

From: Bishop, Michael W. CONTR J9C880 [mailto:Michael.Bishop@je.jfcom.mil]
Sent: Wed 11/30/2005 1:05 PM
To: batik-users@xmlgraphics.apache.org
Subject: RE: Error importing Images into an image tag?



OK, yeah, it doesn't hurt anything.  Just wondered how they ended up
there.  Using the namespace fixed the overall problem and images import
just fine.

Michael Bishop

-----Original Message-----
From: Archie Cobbs [mailto:archie@dellroad.org]
Sent: Wednesday, November 30, 2005 12:59 PM
To: batik-users@xmlgraphics.apache.org
Subject: Re: Error importing Images into an image tag?

Bishop, Michael W. CONTR J9C880 wrote:
> That certainly did it.  Any reason why it adds extra attributes that I
> don't specifically set?

Probably those are default values or something. I.e., semantically
it's the same thing whether or not those other attributes are there.

-Archie

________________________________________________________________________
__
Archie Cobbs      *        CTO, Awarix        *
http://www.awarix.com

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org



RE: Error importing Images into an image tag?

Posted by Tonny Kohar <to...@kiyut.com>.
Hi,

On Fri, 2005-12-02 at 12:29 -0500, Bishop, Michael W. CONTR J9C880
wrote:
>  
> If I use:
> element.setAttributeNS(
>             XLINK_NAMESPACE_URI, "xlink:href", imageName);
>  
> I get the "xlink:href" error when I place the Image, but it works fine when I load the document later.
>  

I do not know why it is error, but make sure the image file path is
correct either as absolute or relative

in case of absolute path you need to set the path something like
file://c:/some_folder/some_image.png

note the file:// protocol format, check the syntax for url protocol

Best Regards
Tonny Kohar
-- 
Sketsa 
SVG Graphics Editor
http://www.kiyut.com


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org