Subject: Re: [xsl] copy of specific elements From: henry human <henry_human@xxxxxxxx> Date: Mon, 18 Aug 2008 14:36:09 +0200 (CEST) |
thank you. With your suggestion I can copy the elements. It is still the problem in my former posting from last week with the for-each loop and position. Maybe you have an idea how to build it. I will at the first determine the number of section elements and than build a loop Which turns as much as the section elements exist in the xml file. I tried following, but it does not work: <xsl:variable name="var" select="count(document/elements/element[@type='section'])"/> <xsl:for-each select="//*[position() <= $var]"> <!-- <xsl:value-of disable-output-escaping="yes" select="document/elements/element[@type='paragraph'][position()]"/> --> LOOP: <xsl:value-of disable-output-escaping="yes" select="position()"/> This code gave back the 2 as the number of the sections which is correctly, but when I use the for-each I get more than 2 turns, namely seven! I can not use the position() to build an array index. You told in last posting : position() doesn't behave as you seem to think it does. What you get means there are in the input tree 6 elements that are the first or second child of their parent element. Could you say how to build this loop correctly ?? I am thankful for your help __________________________________________________ Do You Yahoo!? Sie sind Spam leid? Yahoo! Mail verf|gt |ber einen herausragenden Schutz gegen Massenmails. http://mail.yahoo.com
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] copy of specific elements, Florent Georges | Thread | Re: [xsl] copy of specific elements, Florent Georges |
Re: [xsl] XSL help, Jonas Mellin | Date | Re: [xsl] copy of specific elements, Florent Georges |
Month |