[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Finding all occurences of a node
To get everything below <sub1> I am using: <xsl:template match="child::sub1/child::*"> <xsl:copy-of select="."/> </xsl:template> that match is the same as sub1/* ie it matches any child of sub1. It might be clearer (or might not) to just use match="sub2" in any event, that would have the same effect on your input. But how can I replace all occurences of <myowntag>? Something like <xsl:template match="myowntag"> .... </xsl:template match> doesn't work. Yes it does (if you delete the spurious match in the close tag). At least that template would work if you ever applied any templates to the myowntag element. But you don't. Your first template doesn't use applu-templates it uses copy-of so no templates are applied after that, the whole subtree below sub2 is copied. What you want to do is a) copy the identity transform stylesheet from the XSLT spec. b) add a template for the root node, that makes it jump to sub2 <xsl:template match="/"> <xsl:apply-templates select="sub1/sub2"/> </xsl:template c) add a template for myowntag <xsl:template match="myowntag"> .... </xsl:template> David 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
|