Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 13th, 2013, 02:53 PM
Authorized User
 
Join Date: Aug 2013
Posts: 30
Thanks: 9
Thanked 0 Times in 0 Posts
Default copy or copy-of

dear all,
I am using this code to apply a template to the result of another one

Code:
    
<xsl:template match="tei:div[@type='edition']">       
            <xsl:variable name="nonumber">
                <xsl:call-template name="edition"/>
            </xsl:variable>  
        <xsl:for-each select="$nonumber">
<xsl:copy>
<xsl:apply-templates mode="lb"/>
</xsl:copy>
</xsl:for-each>
           </xsl:template>
It looks like it works, cause I do get the results of the templates in mode="lb" but of what the edition template does no element remains. I think I have some problem in placing xsl:copy / xsl:copy-of in a useful way, as at some trials I did get both results but one after the other rather than together.

Thank you very much for any advise on this.
 
Old November 13th, 2013, 04:01 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

It's not clear what your question is. Does your code work or doesn't it? If it doesn't work, explain what you are trying to achieve and how the result differs. Or perhaps it works and you just want to understand why?
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
 
Old November 13th, 2013, 04:12 PM
Authorized User
 
Join Date: Aug 2013
Posts: 30
Thanks: 9
Thanked 0 Times in 0 Posts
Default

What I would like is to have results of both templates. Like this I get only the second and all the elements produced by the first disappear.

the first inserts the <lb/> on which the second template adds an attribute, as well as many other elements. once I do this only the lb with the number are given as a result.

yes, I would certainly also like to understand the all process.

Thank you very much!
 
Old November 13th, 2013, 08:00 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

I don't know what your input looks like, I don't know what your desired output looks like, I don't know what the templates you are calling actually do, so I really can't say anything helpful.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA Copy Help ks1102 Excel VBA 5 February 10th, 2009 11:08 PM
Copy and Pasting jilly Beginning VB 6 1 March 8th, 2006 09:46 AM
copy-of question. pupu79 XSLT 2 January 8th, 2005 11:51 AM
Copy to Clipboard Clive Astley Access 5 July 16th, 2004 07:16 PM
Copy Database crouseb SQL Server 2000 12 January 14th, 2004 03:36 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.