cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Curro, Joseph" <Joseph.Cu...@time0.com>
Subject RE: [Help!] Concatenating @attributes as parts of XSLT apply-temp late tags
Date Mon, 10 Apr 2000 14:01:04 GMT
I'm not 100% sure if this will work, but you might want to try XPaths
"concat" function.  Something like:

	<xsl:apply-templates select="document(concat("mydirectory/",@file))"
/> 

just might do the trick.

Joe


-----Original Message-----
From: Stuart Roebuck [mailto:sr@adolos.com]
Sent: Monday, April 10, 2000 6:43 AM
To: cocoon-users@xml.apache.org
Subject: [Help!] Concatenating @attributes as parts of XSLT
apply-template tags


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.

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

Mime
View raw message