You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by beyaNet Consultancy <be...@ntlworld.com> on 2004/02/19 10:02:00 UTC

An if statement breaks my SVG!!!!

Hi,
I have a simple xsp:logic section which performs a simple  
instantiation. I then decided to add some conditional code and wham!,  
my code breaks. What am I doing wrong here!!!????

  <xsp:logic>
	int imageNum = 1;
	byte[] photo;
	
	Artist artist = Artist.getArtist(46);
	
	if (imageNum == 1)
	{
		String test = "hello";
	}
	
	<!-- read image into a byte [] -->
	byte[] photo_1 = artist.getArtistPhoto1();
	//byte[] photo_2 = artist.getArtistPhoto2();
	
	<!-- base64 encode byte array -->
	String Photo1 = Base64.encodeBytes(photo_1);
	//String Photo2 = Base64.encodeBytes(photo_2);

  </xsp:logic>
	
	<svg:svg width="300" height="300" y="0" x="0" viewBox="0 35 200 200">
		<xsp:element name="image">
			<xsp:attribute name="x">0</xsp:attribute>
			<xsp:attribute name="y">0</xsp:attribute>
			<xsp:attribute name="width">300</xsp:attribute>
			<xsp:attribute name="height">300</xsp:attribute>
			<xsp:attribute  
name="xlink:href">data:image/jpeg;base64,<xsp:expr>Photo1</xsp:expr></ 
xsp:attribute>
			<xsp:attribute name="id">artist1</xsp:attribute>
		</xsp:element>
	</svg:svg>

many thanks in advance