W3C home > Mailing lists > Public > www-svg@w3.org > January 2004

Help Needed: Using SVG command "use xlink:href="#local_variable_name" in XSLT

From: Patrick Soh <chsoh@must.edu.my>
Date: Tue, 20 Jan 2004 19:26:49 +0800
Message-ID: <000801c3df48$4cf9e230$d801a8c0@ITLAB21>
To: <www-svg@w3.org>
I am trying to put into XSL file the SVG command "use xlink:href="#local_variable_name" but XSL keeps rejecting it. The Error Message is "Error in input XSL: Error: Reference to undeclared namespace prefix:'xlink'. 

The XSL works fine if I change the command to "use xlink-href="#local_variable_name" i.e. as long as I do not refer to xlink:href. 

Attached is my xsl file and xml datafile. 

Any help much appreciated. 

By the way, Happy Chinese New Year to all the chinese out there!

Patrick Soh 

<?xml version="1.0"?>
<!-- 1st Style Sheet to convert traffic details -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" />

<xsl:template match="/">
<!-- xsl:text disable-output-escaping="yes" -->

<xsl:variable name="loc-id"> </xsl:variable>
<!-- xsl:variable name="dtime"  / -->
<!-- ddtime="{$dtime}{title}"></ddtime -->
<svg xmlns="http://www.w3.org/2000/svg">
<date> <xsl:value-of select="//page/title" /> </date>
<time>  <xsl:value-of select="//page/row/eventtime" />

 <xsl:for-each select="//page/row">
  <!-- xsl:text disable-output-escaping="yes" -->
   <use xlink:href="#{$loc-id}{locationid}" stroke="{color}"/>
   <!-- /xsl:text -->
<!-- /xsl:text -->


My xml data file is 
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="trafficdetails1901.xsl"?>
<page xmlns:sql="http://apache.org/cocoon/SQL/2.0">

<title>19/01/2004 </title>
 <description>SMOOTH TRAFFIC</description>
 <description>HEAVY TRAFFIC</description>
 <description>BUMPER-TO-BUMPER TRAFFIC</description>
Received on Tuesday, 20 January 2004 06:32:00 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:46:57 UTC