cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arno de Quaasteniet" <a...@artefact.nl>
Subject Re: copy with attributes
Date Sun, 20 Feb 2000 13:30:16 GMT
RE: copy with attributesThis also works (at least for XT)

<xsl:for-each select="@*">
    <xsl:copy/>
</xsl:for-each>

It's for you to decide if this is a more elegant way ;o)

Arno

----- Original Message ----- 
  From: Larry Blanchette 
  To: 'cocoon-users@xml.apache.org' 
  Sent: Friday, February 18, 2000 11:59 PM
  Subject: RE: copy with attributes


  your running into the built in rule for the child nodes, you can circumvent this with mode


  <xsl:template match="@*|node()" mode="copy"> 
          <xsl:copy> 
                  <xsl:apply-templates select="@*|node()" mode="copy"/> 
          </xsl:copy> 
  </xsl:template> 

  <xsl:template match="table"> 
          <xsl:copy> 
                  <xsl:apply-templates select="@*|node()" mode="copy"/> 
          </xsl:copy> 
  </xsl:template> 

  maybe there is a more elegant solution but this should do the trick 

  larry 

  -----Original Message----- 
  From: Duncan Werner [mailto:dawerner@bellatlantic.net] 
  Sent: Friday, February 18, 2000 1:48 PM 
  To: Cocoon 
  Subject: xsl: copy with attributes 



  I'm having trouble using xsl:copy and preserving attributes. In the 
  following tempate, any attributes from the <table> tag will be dumped 
  out as text in the resulting page. I've looked in a few docs, and 
  I think I'm doing this right. If anyone has any insight, am I doing this 
  wrong, or is this behavior not supported in xalan? 

  <xsl:template match="table"> 
      <xsl:copy> 
          <xsl:apply-templates select="@*"/> 
          <xsl:apply-templates/> 
      </xsl:copy> 
  </xsl:template> 

  thanks, 
  duncan werner 



  --------------------------------------------------------------------- 
  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