You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by João César <jo...@duploclique.com> on 2003/05/03 19:46:31 UTC

Simple question...

Hi all

Can we do this?

<xsl:variable name="aux"><xsl:value-of select="."/></xsl:variable>
<nome><xsl:value-of
select="experts/artigos/DocSum[Id='$aux']/Item[@Name='Authors']"/></nome>

Is the syntax use of $aux in the second line correct?

It is not working :|

Joao Cesar
joaocesar@duploclique.com

Computer Science Student's @ University of Lisboa, PORTUGAL



---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: Simple question...

Posted by "J.Pietschmann" <j3...@yahoo.de>.
João César wrote:
> <xsl:variable name="aux"><xsl:value-of select="."/></xsl:variable>
> <nome><xsl:value-of
> select="experts/artigos/DocSum[Id='$aux']/Item[@Name='Authors']"/></nome>
> 
> Is the syntax use of $aux in the second line correct?
If the processor doesn;t rise an exception the syntax is
correct. Whether the code matches your intentions, well,
you didn't explain them that much in depth.

I guess, however, you meant
  <xsl:variable name="aux" select="."/>
  <nome>
    <xsl:value-of
        select="experts/artigos/DocSum[Id=$aux]
                /Item[@Name='Authors']"/>
  </nome>

In your code '$aux' is a string containing a dollar sign
and the characters a, u and x, rather that the reference
to the variable named "aux".

BTW XSLT questions are best asked on the XSL list:
   http://www.mulberrytech.com/xsl/xsl-list/
although Cocoon folks is also quite knowledgable.
It is usually recommended to show some more context,
like the relevant snippet of the XML input and the match
of the template the XSLT code snippet is in, as well
as stating the "doesn't work" part in some more detail,
like "the content of <nome> is comes out empty".

J.Pietschmann


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: Simple question...

Posted by Miles Elam <mi...@pcextremist.com>.
Have you tried spitting out the exact value of the variable on its own?

eg.  '<xsl:value-of select="$aux"/>'

including the quotes on either end?  This would verify that you have a 
value in the variable and there is no whitespace gumming up the works.

- Miles Elam


João César wrote:

>Yes we tried a static value and it's working that way, and it's a tag, we
>really don't understand what's the problem because we think this would be a
>simple issue...
>
>Thanks :|
>
>Joao Cesar
>joaocesar@duploclique.com
>
>Computer Science Student's @ University of Lisboa, PORTUGAL
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: Simple question...

Posted by João César <jo...@duploclique.com>.
Yes we tried a static value and it's working that way, and it's a tag, we
really don't understand what's the problem because we think this would be a
simple issue...

Thanks :|

Joao Cesar
joaocesar@duploclique.com

Computer Science Student's @ University of Lisboa, PORTUGAL


----- Original Message ----- 
From: "Miles Elam" <mi...@pcextremist.com>
To: <co...@xml.apache.org>
Sent: Saturday, May 03, 2003 6:55 PM
Subject: Re: Simple question...


> João César wrote:
>
> >Can we do this?
> >
> ><xsl:variable name="aux"><xsl:value-of select="."/></xsl:variable>
> ><nome><xsl:value-of
> >select="experts/artigos/DocSum[Id='$aux']/Item[@Name='Authors']"/></nome>
> >
>
> Is "Id" an attribute or a tag?  If it's an attribute, you need "@Id"
> instead.  It looks like it would work otherwise.  Have you tried using
> the XPath with a static value to check validity?
>
> eg. experts/artigos/DocSum[Id='5']/Item[@Name='Authors']
>
> Does that work?
>
> - Miles Elam
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>



---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: Simple question...

Posted by Miles Elam <mi...@pcextremist.com>.
João César wrote:

>Can we do this?
>
><xsl:variable name="aux"><xsl:value-of select="."/></xsl:variable>
><nome><xsl:value-of
>select="experts/artigos/DocSum[Id='$aux']/Item[@Name='Authors']"/></nome>
>

Is "Id" an attribute or a tag?  If it's an attribute, you need "@Id" 
instead.  It looks like it would work otherwise.  Have you tried using 
the XPath with a static value to check validity?

eg. experts/artigos/DocSum[Id='5']/Item[@Name='Authors']

Does that work?

- Miles Elam



---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org