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

Re: Assigning unique id to new node using generate-id(

Subject: Re: Assigning unique id to new node using generate-id()
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 14 Aug 2003 10:26:31 +0100
java generate unique id

    + number('1')"/

means take the number 1 make is a string '1' and then make it a number
number('1')

that would be kinder on the system 9not that you really have to be kind
to machines) as +1


I never really understand why xsl:attribute is so popular.


        <profile>
            <xsl:attribute name="nextCredentialID">
                <xsl:value-of select="number(@nextCredentialID) + number('1')"/>
            </xsl:attribute>
            <xsl:for-each select="credential">
                <xsl:copy-of select="."/>
            </xsl:for-each>
            <credential>
                <xsl:attribute name="id">
                    <xsl:value-of select="concat('c', @nextCredentialID)"/>
                </xsl:attribute>
                <username><xsl:value-of select="$username"/></username>
                <password><xsl:value-of select="$password"/></password>
                <description><xsl:value-of select="$description"/></description>
                <lastModified><xsl:value-of
select="java:getCurrentDateTimeGMT($dateHelper)"/></lastModified>
            </credential>
.... misssing end elements:-)
 


The could be written


   <profile nextCredentialID={@nextCredentialID + 1}">
     <xsl:copy-of select="credential"/>
     <credential id="c{@nextCredentialID)}">
                <username><xsl:value-of select="$username"/></username>
                <password><xsl:value-of select="$password"/></password>
                <description><xsl:value-of select="$description"/></description>
                <lastModified><xsl:value-of
select="java:getCurrentDateTimeGMT($dateHelper)"/></lastModified>
            </credential>
  </profile>

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

 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.