[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: xsl:copy-of O.K. on RTF, but nothing on <EMPTY/> e
William,
I've been out for a couple of days, only catching up now, but your message caught my eye. I can't explain the behavior you are seeing (which processor are you using?). The only difference between models that have a space and those that don't is the presence of that space. xsl:copy-of will create a RTF in either case. So will xsl:apply-templates. Whether a variable refers to a node set or to an RTF depends on how that variable is declared; there too, the presence of a text node won't make a difference as to the data type of what is bound to the variable. That having been said, I think you could cut the Gordian knot (not worrying about the entanglements) by simply straightening up your code. Instead of using a for-each, try something like this: <xsl:param name="segment" select="CALIFORNIA"/> <xsl:variable name="messages" select="document($LookupFilename)//msgs/msg"/> <!-- binds the set of msg nodes to the variable, once, globally --> <xsl:template match="main-msg"> <xsl:variable name="msg-name" select="@name"/> <xsl:variable name="msg-fill-contents" select="$messages[@name = $msg-name]/segment[@name = $segment]/markup"/> <!-- ...do your thing with msg-fill-contents ... BTW it's now a node-set, not an RTF as it would be using either apply-templates OR copy-of as the contents of the xsl:variable element --> </xsl:template> If this or something like it doesn't work, please post again with a reduced example demonstrating the bug (test it before posting ;-). If this problem isn't actually at the heart of your question, and it doesn't help to warn you that your theory is incorrect (the presence of the space makes what would otherwise be a node-set into an RTF -- it doesn't) ... you have another reason to post back. I hope that helps-- Wendell or not should be the presence At 05:30 PM 4/23/2003, you wrote: My basic question: (follow-on to my yesterday e-mail) The error is probably in how the node is selected, not in the fact that one of them has a space....wap
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
|