From: Bruce L. (c) <bl...@sa...> - 2000-08-07 23:07:15
|
Hi All, How do I match the second teir elements but not their children: <?xml...?> <news_detail> <author> <author_name> <first_name></first_name> <middle_initial></middle_initial> <last_name></last_name> </author_name> </author> </news_detail> I have been using <xsl:template match="news_detail/*" name="news_detail"> . . . </xsl:template> and calling it thus: . . . <xsl:apply-templates select="//*/*"/> <!-- for another template --> <xsl:apply-templates select="news_detail"/> . . . The problem is that I get the author_name node and the first_name, last_name and middle_initial child nodes. I only want the node list to include the <author> tag. <item delimiter="," name="author_name"/> <item delimiter="," name="first_name"/> <item delimiter="," name="middle_initial"/> <!-- I DONT WANT THESE IN THE OUTPUT --> What XPath expression do I need to use ? Also - even though I am calling the two templates explicitly using select, does the pattern from the first template still carry over ? Why ? How do I stop this? Thanks Heaps, Bruce. Bruce Long (c) Sapient | Architects for the New Economy Level 13, 60 Castlereagh Street Phone: +612 9210.2067 Sydney, NSW 2000 Fax: +612 9210.2500 Australia Email: <bl...@sa...> |