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

Re: 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:43:13 +0800
Message-ID: <000b01c3df4a$969c3760$d801a8c0@ITLAB21>
To: <www-svg@w3.org>
Apologies, but the attached files are slightly wrong. Have pasted them in this mail again. 
Just in case anyone tries it out. 
  ----- Original Message ----- 
  From: Patrick Soh 
  To: www-svg@w3.org 
  Sent: Tuesday, January 20, 2004 7:26 PM
  Subject: Help Needed: Using SVG command "use xlink:href="#local_variable_name" in XSLT

  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 

  My XSL File :-
  <?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 -->
  <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-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:48:59 UTC

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