cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stuart Roebuck ...@adolos.com>
Subject [Help!] Concatenating @attributes as parts of XSLT apply-template tags
Date Mon, 10 Apr 2000 10:43:02 GMT
This problem is really causing difficulties...any help very much appreciated.

I'm having trouble trying to concatenate attributes in apply-template  
tags.  I think the easiest way of explaining the problem is to give an  
example.

I have the following <xsl:template match="..."> XSLT template that works well:

  <xsl:template match="include">
   <xsl:apply-templates select="document(@file)" />
  </xsl:template>

Given an XML document with the construct:

  <include file="filename.xml" />

It takes the content of the file 'filename.xml' and incorporates it into  
the document.


However...

I want to be able to put that file in a different directory without  
changing the <include...> tag entry.

I therefore what to produce a template something like:

  <xsl:template match="include">
   <xsl:apply-templates select="document(mydirectory/@file)" />  <!-- THIS  
DOESN'T WORK -->
  </xsl:template>

I don't seem to be able to concatenate the attribute reference '@file'  
onto the end of a root file URL.

Am I trying to do something impossible, or is there a syntax to get round  
this kind of problem?

For non-XSLT tags I think I could get away with: 'mydirectory/{@file}' but  
that doesn't seem to work with the <xsl apply-templates...> tag.

Mime
View raw message