cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From beyaNet Consultancy <beya...@ntlworld.com>
Subject Re: XML Parsing Error: no element found
Date Mon, 22 Mar 2004 11:29:43 GMT
Ok,
I have come across a solution which works! It is:

<svg>
	<xsp:logic>
		int svgWidth = Integer.parseInt(<util:get-sitemap-parameter  
name="svgWidth"/>);
		int svgHeight = Integer.parseInt(<util:get-sitemap-parameter  
name="svgHeight"/>);
	
		<xsp:attribute  
name="width"><xsp:expr>svgWidth</xsp:expr></xsp:attribute>
		<xsp:attribute  
name="height"><xsp:expr>svgHeight</xsp:expr></xsp:attribute>
		<xsp:attribute name="viewBox">0 0 <xsp:expr>svgWidth</xsp:expr>  
<xsp:expr>svgHeight</xsp:expr></xsp:attribute>

I was under the impression that you could only use <xsp:attribute/>  
within an <xsp:element/> tag. It seems not! very nice....

Peter
On 22 Mar 2004, at 10:46, beyaNet Consultancy wrote:

> hi,
> I am getting the above error message when I try and run the following  
> xsp page. Can I do this? If not how do I??
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <xsp:page language="java"
> 	xmlns:xsp="http://apache.org/xsp"
> 	xmlns:util="http://apache.org/xsp/util/2.0"
> 	xmlns:xlink="http://www.w3.org/1999/xlink"
> 	xmlns="http://www.w3.org/2000/svg">
>
> <xsp:structure>
>    <xsp:include>test.ArtistImages</xsp:include>
> </xsp:structure>
>
> <xsp:element name="svg">
> 	<xsp:logic>
> 		int svgWidth = Integer.parseInt(<util:get-sitemap-parameter  
> name="svgWidth"/>);
> 		int svgHeight = Integer.parseInt(<util:get-sitemap-parameter  
> name="svgHeight"/>);
> 	</xsp:logic>
>
> 		<xsp:attribute  
> name="width"><xsp:expr>svgWidth</xsp:expr></xsp:attribute>
> 		<xsp:attribute  
> name="height"><xsp:expr>svgHeight</xsp:expr></xsp:attribute>
>
> 	<xsp:logic>
>
> 		....... Code.........
> 	</xsp:logic>	
> 	
> 	<!-- spit the image back to the browser requester -->
> 	<xsp:element name="svg">
> 		<xsp:attribute  
> name="width"><xsp:expr>svgWidth</xsp:expr></xsp:attribute>
> 		<xsp:attribute  
> name="height"><xsp:expr>svgHeight</xsp:expr></xsp:attribute>
> 		<xsp:attribute name="viewBox">0 0 <xsp:expr>svgWidth</xsp:expr> 

> <xsp:expr>svgHeight</xsp:expr></xsp:attribute>
> 		<xsp:element name="image">
> 			<xsp:attribute name="x">0</xsp:attribute>
> 			<xsp:attribute name="y">0</xsp:attribute>
> 			<xsp:attribute name="border">0</xsp:attribute>
> 			<xsp:attribute  
> name="width"><xsp:expr>imgWidth</xsp:expr></xsp:attribute>
> 			<xsp:attribute  
> name="height"><xsp:expr>imgHeight</xsp:expr></xsp:attribute>
> 			<xsp:attribute  
> name="xlink:href">data:image/jpeg;base64,<xsp:expr>base64</xsp:expr></

> xsp:attribute>
> 		</xsp:element>
> 	</xsp:element>
> </xsp:element>
>
> My pipeline is:
>
> 			<map:match pattern="**artistImage/*/*/*/*.jpg">
> 			 <map:generate type="serverpages" src="xsp/svg.xsp">
> 				<map:parameter name="imageNum" value="{5}"/>
> 				<map:parameter name="artistID" value="{2}"/>
> 				<map:parameter name="svgWidth" value="{3}"/>
> 				<map:parameter name="svgHeight" value="{4}"/>
> 			 </map:generate>
> 				<map:serialize type="svg2jpeg"/>			
> 			</map:match>
Mime
View raw message