Subject: RE: [xsl] Question with xsl:copy-of and xsl:value-of From: "Sullivan, Dan" <dsullivan@xxxxxxxxxxx> Date: Thu, 6 Sep 2001 06:57:26 -0700 |
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: [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>®</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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Question with xsl:copy-of, Oleg Tkachenko | Thread | [xsl] Child Nodes, Carlos Durand Silves |
Re: [xsl] Testing using XPath, Jeni Tennison | Date | RE: [xsl] Child Nodes, Sullivan, Dan |
Month |