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

RE: how to show one number of input text fields. help

Subject: RE: how to show one number of input text fields. help please
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Thu, 12 Jun 2003 12:30:30 +0100
input only numbers

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> Dionisio Ruiz de Zarate
> Sent: 12 June 2003 08:39
> To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  how to show one number of input text fields. 
You mean, you want the output to contain 20 elements, of which the first
n are derived from the input, and the other (20-n) are invented?  Then
you want:

<xsl:apply-templates select="texto"/>
<xsl:for-each select="1 to (20-count(texto))">
  <dummy/>
</xsl:for-each>

The only trouble is, this is XPath 2.0 syntax. To achieve the same
effect in 1.0, either

(a) write a recursive template that takes a parameter indicating how
many elements to output; it should output one element and then (if the
count is non-zero) call itself to output the remaining n-1

(b) use the trick <xsl:for-each select="(//node())[position() &lt;
$n]">, provided there are at least $n nodes in your input file.

Michael Kay



> help please
> 
> 
> HEllo i have one great problem, for me, and i am working in 
> this problem during 2 weeks and i cannot solve it. the problem is:
> 
> i have one xml file with, for example, three nodes:
> <texto titulo=\"uno\" url=\"\"/>
> <texto titulo=\"uno\" url=\"\"/>
> <texto titulo=\"uno\" url=\"\"/>
> 
> and i want to show the titulo of the nodes (texto) into some 
> text input fields (<input type="text"..). I want to show 20 
> input text fields but only some of them will be with text, in 
> this examplo 3. how can i make this? how can i show 20 input 
> text fields if only i have text for three of them. i am 
> trying with this: <xsl:for-each select="texto[position() &lt; 
> 20]"> <input type="text" name="mensaje" size="35"> 
> <xsl:attribute name="value"><xsl:value-of 
> select="@titulo"/></xsl:attribute>
> </input>
> but only appears in this method 3 text fields.
> i want to show 20
> 
> can you help me please?
> thanks
> 
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.