[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: xslt svg problem

Subject: Re: xslt svg problem
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 3 Sep 2001 16:13:35 +0100
xslt img problem
   >P.s.: that's my XSL:

the cause of your problem (the namespace) has already been mentioned,
but _why_ do people use xsl:element and xsl:attribute so much?

   ><xsl:template match="/">
   >	<xsl:element name="HTML">
   >		<xsl:element name="HEAD">
   >			<xsl:element
   >name="TITLE">imagemapbeispiel</xsl:element>
   >		</xsl:element>
   >		<xsl:element name="BODY">
   >			<xsl:element name="IMG">
   >				<xsl:attribute name="src">out.png</xsl:attribute>	
   >	
   >				<xsl:attribute  name = "usemap"
   >>#explmap</xsl:attribute>			
   >			</xsl:element>
   >			<xsl:element  name = "MAP">
   >				<xsl:attribute  name = "name"
   >>explmap</xsl:attribute>
   >				<xsl:apply-templates/>
   >			</xsl:element>
   >		</xsl:element>	
   >	</xsl:element> 
   ></xsl:template>

That is

<xsl:template match="/">
 <HEAD>
  <TITLE>imagemapbeispiel</TITLE>
  <BODY>
   <IMG src="out.png" usemap="#explmap"/>
   <MAP name="explmap">
        <xsl:apply-templates/>
   </MAP
  </BODY>
 </HEAD>
</xsl:template>

   ><xsl:template match="a">
   >					<xsl:element  name = "AREA">
   >						<xsl:attribute  name = "href" >
   >							<xsl:value-of select="@xlink:href" />
   >						</xsl:attribute>
   >						<xsl:attribute  name = "shape"
   >>rect</xsl:attribute>
   >						<xsl:variable name = "reftext"><xsl:value-of
   >select="text"/></xsl:variable>
   >						<xsl:variable name = "length"><xsl:value-of
   >select = "string-length($reftext)*5"/></xsl:variable>
   >						<xsl:variable name = "xwert">
   >							<xsl:value-of select = "text/@x" />
   >						</xsl:variable>
   >						<xsl:variable name = "ywert">
   >							<xsl:value-of select = "text/@y" />		
   >						</xsl:variable>	
   >						<xsl:variable name = "xwert2">
   >							<xsl:value-of select = "$xwert+$length" />
   >						</xsl:variable>		
   >						<xsl:variable name = "ywert2">
   >							<xsl:value-of select = "$ywert+-19" />		
   >						</xsl:variable>			
   >						<xsl:attribute  name = "coords" >
   >							<xsl:value-of select = "$xwert" />
   >							<xsl:text>,</xsl:text>
   >							<xsl:value-of select = "$ywert2" />
   >							<xsl:text>,</xsl:text>
   >							<xsl:value-of select = "$xwert2" />
   >							<xsl:text>,</xsl:text>
   >							<xsl:value-of select = "$ywert" />
   >						</xsl:attribute>
   >					</xsl:element>
   >				</xsl:template>
   

and that is

<xsl:template match="a">
 <AREA 
   href="{@xlink:href}"
   shape="rect"
   coords="{text/@x},{text/@y - 19},{text/@x + string-length(text)*5},{text/@y}"/>
</xsl:template>

David

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.