[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XSLT Merge question

Subject: Re: XSLT Merge question
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 26 Jun 2003 15:50:38 +0100
xslt merge elements

          <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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.