[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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

Subject: RE: Question with xsl:copy-of and xsl:value-of
From: "Sullivan, Dan" <dsullivan@xxxxxxxxxxx>
Date: Thu, 6 Sep 2001 06:57:26 -0700
title tag in xsl
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@xxxxxxxxxxxxxxxxxxxxxx
[mailto:wbchmura@xxxxxxxxxxxxxxxxxxxxxx]
Sent: Thursday, September 06, 2001 9:49 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject:  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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.