Hi,
I have been trying to resolve an issue with how to make an opening svg tag dynamic, in terms of the width and height, and wondered if you have an suggestions. I have an xsp page which spits out an svg as so:
<xsp:structure>
</xsp:include>
</xsp:structure>
<svg width="x" height="x" x="0" y="0">
<xsp:logic>
........... Code ....................
int svgWidth = Integer.parseInt(<util:get-sitemap-parameter name="svgWidth"/>);
int svgHeight = Integer.parseInt(<util:get-sitemap-parameter name="svgHeight"/>);
</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> </xsp:expr></xsp:attribute>
<xsp:element name="image">
<xsp:attribute name="x"></xsp:attribute>
<xsp:attribute name="y"></xsp:attribute>
<xsp:attribute name="border"></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></xsp:attribute>
</xsp:element>
</xsp:element>
</svg>
What I need to be able to do is to construct the opening svg tag by pulling in the values of svgWidth and svgHeight. So for example:
<svg width="svgWidth" height="svgHeight">
How would I go about doing this in this instance?
Peter
- Re: Dynamic SVG tag... beyaNet Consultancy
- Re: Dynamic SVG tag... Derek Hohls
- Re: Dynamic SVG tag... beyaNet Consultancy
