cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From beyaNet Consultancy <beya...@ntlworld.com>
Subject An if statement breaks my SVG!!!!
Date Thu, 19 Feb 2004 09:02:00 GMT
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
Mime
View raw message