Subject: Re: [xsl] XSLT Merge question From: David Carlisle <davidc@xxxxxxxxx> Date: Thu, 26 Jun 2003 15:50:38 +0100 |
<xsl:when test="action != ''"> <xsl:apply-templates select="action"/> </xsl:when> That says that if any element has an action child that has a string value that is non empty then you do not copy the element but just process the action. I don't think you want that, I think you want all existing elements to be copied so you want the xsl:copy on the outside of teh xsl:choose. Or rather you don't want the xsl:choose at all, you just want teh standard identity template there, and then have one extra template for actions that pulls in your elements (not tags, tags are something else) from the external file. <xsl:when test="action != ''"> only works because of the white space used for indenting <action> <a/> <b/> </action> is true for that test as its string value is a few newlines and spaces, but if your stylesheet had xsl:strip-space (or used microsoft's parser) or looked like <action><a/><b/></action> then the string value of action would be empty and so that test would fail. <xsl:variable name="pathvalue"><xsl:value-of select="@path" /></xsl:variable> Almost never do that it can be slow and expensive, it generates a reult tree fragment that has a text node with the string value of teh attribute. You just want <xsl:variable name="pathvalue" select="@path"/> which has the attribute directly (what you have should work though) ________________________________________________________________________ This e-mail has been scanned for all viruses by Star Internet. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] XSLT Merge question, David Carver | Thread | [xsl] efficiently following threads, Lars Huttar |
RE: [xsl] 2 level grouping, cknell | Date | Re: [xsl] 2 level grouping, Jeroen Janssen |
Month |