ASP Error: 70
Description: Permission denied
Source: Microsoft VBScript runtime error

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

Sequence numbering

Subject: Sequence numbering
From: Arthur Maloney <ArthurM@xxxxxxxxxx>
Date: Thu, 30 Dec 2004 07:54:10 +0000
sequence numbering
Hello xsl-list,

How do I get a numbered sequence for a sorted list excluding a few nodes?
below is the output I'm getting

Note 1: objectId, address,DbAddress  etc are correct as per sort & exclusion.
      (0),(9),(14) etc are as source node list no-sort but excluded
      correct sorted sequence would be 0,1, 2 etc (the excluded sorted order -1).

Note 2: Its for a database - ordinal position is quicker than...["objectId"]


SqlDataReader dr=cmd.ExecuteReader();

while (dr.Read())
{
        if ( ! dr.IsDBNull(0))
        {
                objectId=dr.GetInt32(0);
        }

        if ( ! dr.IsDBNull(9))
        {
                address=dr.GetString(9);
        }

        if ( ! dr.IsDBNull(14))
        {
                DbAddress=dr.GetString(14);
        }

        if ( ! dr.IsDBNull(13))
        {
                DbName=dr.GetString(13);
        }
....

Its a for-each loop and I exclude some nodes with a test

Problem occurs with number at:
                                <xsl:call-template name="columnOrdinal">
                                        <xsl:with-param name="sequence">
                                        <xsl:number  level="any"/>
                                        </xsl:with-param>
                                </xsl:call-template>
Note : columnOrdinal just rebases i.e. number-1 (works fine)



Code Full Listing:

<xsl:for-each select="$table/columns/column"><!--Put primary key col(s) at head of list -->
<xsl:sort select="@inPrimaryKey" order="descending"/>
<xsl:sort select="./colName"/>
<xsl:choose>
 <xsl:when test="./colName= 'rowGUID'"></xsl:when>
 <xsl:when test="./colName= 'auto_rv'" ></xsl:when>
 <xsl:when test="./colName= 'rowCreatedBy'"></xsl:when>
 <xsl:when test="./colName= 'rowCreated'"></xsl:when>
 <xsl:when test="./colName= 'rowModified'"></xsl:when>
 <xsl:when test="./colName= 'rowModifiedBy'"></xsl:when>
 <xsl:otherwise>
        <xsl:variable name="colOrdinal">
                <xsl:call-template name="parenthesize">
                        <xsl:with-param name="value">
                                <xsl:call-template name="columnOrdinal">
                                        <xsl:with-param name="sequence">
                                        <xsl:number  level="any"/>
                                        </xsl:with-param>
                                </xsl:call-template>
                        </xsl:with-param>
                </xsl:call-template>
        </xsl:variable>
 
        <xsl:call-template name="if-stmt">
        <xsl:with-param name="line" select="2"/>
        <xsl:with-param name="tab" select="$tab+2"/>
        <xsl:with-param name="expression">
        <xsl:text> ! dr.IsDBNull</xsl:text>
        <xsl:value-of select="$colOrdinal"/>
        </xsl:with-param>
        <xsl:with-param name="stmt">
                <xsl:choose>
                        <xsl:when test="./@identity='true'">
                        <xsl:text>objectId</xsl:text>
                        </xsl:when>
                        <xsl:otherwise>
                        <xsl:value-of select="./colName"/>
                        </xsl:otherwise>
                </xsl:choose>
                
                <xsl:text>=dr.</xsl:text>
                        
                <xsl:call-template name="replace">
                                <xsl:with-param name="value">
                                <xsl:value-of select="./@NetFrameworkTypedAccessor"/>                           
                                </xsl:with-param>
                                <xsl:with-param name="search-string">
                                <xsl:text>()</xsl:text>
                                </xsl:with-param>
                                <xsl:with-param name="replace-string">
                                        <xsl:value-of select="$colOrdinal"/>
                                </xsl:with-param>
                        </xsl:call-template><!-- end replace -->
                </xsl:with-param>
</xsl:call-template><!-- end if-stmt -->                                                                
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>





-- 
Best regards,
 Arthur                          mailto:ArthurM@xxxxxxxxxx

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.