This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: deep "copy-of" a source fragment


Hi,

You want to get to the body and then copy the elements. For example:

<xsl:template match="/html">

  <xsl:apply-templates select="body" mode="identity"/>
       
</xsl:template>

<xsl:template match="node()|@*" mode="identity">

  <xsl:copy>
    <xsl:copy-of select="@*"/>
    <xsl:apply-templates mode="identity"/>
  </xsl:copy>
       
</xsl:template>

best,
-Rob


> -----Original Message-----
> From: owner-xsl-list@lists.mulberrytech.com
> [mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of Terence
> Kearns
> Sent: Tuesday, September 03, 2002 11:48 PM
> 
> Hi everyone, I just joined this list so "greetings". I joined because 
> even after reading the entire 
> http://www.dpawson.co.uk/xsl/sect2/N1930.html page on copying, and 
> reading the reference on xsl:copy and xsl:copy-of I am still vexed by an 
> annoying problem. I'm using XALAN through the ColdFusion MX 
> implementation of their xmlTransform() function. I'm not sure exactly 
> which version of Xalan that is.
> 
> I'm trying to deep copy [the _content_ of] an xhtml body element. I have 
> users who enter arbitary HTML which I then pass through HTML TIDY which 
> produces a nice well-formed XHTML document for me. I want to extract the 
> body and store the content only.
> 



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]