xsl-list
[Top] [All Lists]

Re: Problem with this XSLT - Help!!!!!

2004-02-18 09:25:25
It seems that you're not passing the correct ID param
value or not setting the ID param value at all...

I tryed:

xsltproc --stringparam ID U-05585 b.xsl a.xml

and the result is /users/local/u/john
as you expected.

Rui

On Wed, 2004-02-18 at 16:00, Aitor San Juan wrote:
Hello all,

     I'm stuck with simple XSL transformation. I just want to get the "home"
directory of a user given his ID (a unique code). Trying this transformation
with user id "U-05585", I always get the value "/users/local/u" and it
should be "/users/local/u/john".

     Can anybody help me? What am I doing wrong or missing?

     Thanks in advance.

My XSL file:
===================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
version="1.0">
<xsl:param name="ID"/>
   <xsl:output method="text" indent="no" omit-xml-declaration="yes"
              encoding="ISO-8859-1"/>

   <xsl:strip-space elements="*"/>

   <xsl:template match="/">
      <xsl:value-of
select="concat(/users/@dirbase,/users/user[(_at_)id=$ID]/home)"/>
   </xsl:template>
</xsl:stylesheet>


My INPUT file:
===================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<users dirbase="/users/local/u">
   <user id="U-05585">
       <name>User Name 1</name>
       <home>/john</home>
   </user>
</users>


************ LEGEZKO OHARRA / AVISO LEGAL / LEGAL ADVICE *************
Mezu honek isilpeko informazioa gorde dezake, edo jabea duena, edota legez
babestuta dagoena.
Zuri zuzendua ez bada, bidali duenari esan eta ezabatu, inori berbidali
edo gorde gabe,legeak debekatzen duelako mezuak erabiltzea baimenik gabe.
--------------------------------------------------------------------------
Este mensaje puede contener informacin confidencial, en propiedad o
legalmente protegida.
Si usted no es el destinatario, le rogamos lo comunique al remitente
y proceda a borrarlo, sin reenviarlo ni conservarlo, ya que su uso no 
autorizado est prohibido legalmente.
--------------------------------------------------------------------------
This message may contain confidential, proprietary or legally privileged
information.
If you are not the intended recipient of this message, please notify it to
the sender and delete without resending or backing it, as it is legally
prohibited.
************************************************************************** 



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
-- 
Rui Alberto L. Gonçalves <rui-l-goncalves(_at_)ptinovacao(_dot_)pt>
PT Inovação


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