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]

RE: Question with xsl:copy-of and xsl:value-of


You can use an identity transform to do this. For example here is a
stylesheet that extracts the info you are looking for.

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                version="1.0">

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

  <xsl:template match="/resource">
    <result>
    <xsl:apply-templates select="title/node()"/>
  </result>
</xsl:template>

</xsl:stylesheet>


Dan

-----Original Message-----
From: wbchmura@Ensign-BickfordInd.com
[mailto:wbchmura@Ensign-BickfordInd.com]
Sent: Thursday, September 06, 2001 9:49 AM
To: xsl-list@lists.mulberrytech.com
Subject: [xsl] Question with xsl:copy-of and xsl:value-of 



Hi All,

I have a XML file that contains lines like:

<resource name="p_msc" type="packagingbulletin" format="pdf">
	<title>P <small><sup>&#174;</sup></small>  MS (MSC) series
Canadian 
Packaging Bulletin</title>
	<link>pkb_can_msc.pdf</link>
</resource>

I need to extact the contents of the <title> tag intact.  If I do a 
value-of, it looses the tags inside of it.  If I do a copy-of I get the 
<title> tag also.  I need to be able to just get the contents of the 
<title> tag without the <title> around it.

Any help would be greatly appreciated

thanks


Bill Chmura
Ensign-Bickford Industries, Inc.
Information Technologies Department




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


 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]