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

Re: copy of specific elements

Subject: Re: copy of specific elements
From: henry human <henry_human@xxxxxxxx>
Date: Mon, 18 Aug 2008 14:36:09 +0200 (CEST)
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() &lt;= $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

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.