[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: copy of specific elements
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
|
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
|