[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
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>®</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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|