Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4553484
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T16:57:11+00:00 2026-05-21T16:57:11+00:00

<row> <cell>Phrase 1</cell> #0 <check shuffle=False> <option key=1/> #1 <option key=0/> #2 <option key=0/>

  • 0
        <row>
             <cell>Phrase 1</cell> #0
                <check shuffle="False">
                    <option key="1"/> #1
                    <option key="0"/> #2
                    <option key="0"/> #3
                    <option key="0"/> #4
                    <option key="0"/> #5
                    <option key="0"/> #6
                </check>
                <cell>Phrase 2</cell> #7
                <cell>Phrase 3</cell> #8
                <check shuffle="False">
                    <option key="1"/> #9
                    <option key="0"/> #10
                    <option key="0"/> #11
                    <option key="0"/> #12
                    <option key="0"/> #13
                    <option key="0"/> #14
                </check>
            </row>

I’ve got the following quandary.

I need to find the “index” in the “row” tag for both cells and the each option.

How do I do this in XSL? Each cell counts as one and each “option” children tags in any siblings also count. I’ve labeled the “indexes” I would like to retrieve. I realize there will probably be one way for determining the index of a “cell” versus a “option” element.

I know a bit about XSL but just enough to get my in trouble and quite frustrated. Any help is appreciated.

Thanks as always SO!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T16:57:12+00:00Added an answer on May 21, 2026 at 4:57 pm

    Use xsl:number:

    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
        <xsl:template match="node()|@*" name="identity">
            <xsl:copy>
                <xsl:apply-templates select="node()|@*"/>
            </xsl:copy>
        </xsl:template>
        <xsl:template match="cell|option">
            <xsl:call-template name="identity"/>
            <xsl:variable name="vPosition">
                <xsl:number count="cell|option" level="any" from="row" />
            </xsl:variable>
            <xsl:value-of select="$vPosition - 1"/>
        </xsl:template>
    </xsl:stylesheet>
    

    With this input (more rows):

    <table>
        <row>
            <cell>Phrase 1</cell> #0                 
            <check shuffle="False">
                <option key="1"/> #1                     
                <option key="0"/> #2                     
                <option key="0"/> #3                     
                <option key="0"/> #4                     
                <option key="0"/> #5                     
                <option key="0"/> #6                 
            </check>
            <cell>Phrase 2</cell> #7                 
            <cell>Phrase 3</cell> #8                 
            <check shuffle="False">
                <option key="1"/> #9                     
                <option key="0"/> #10                     
                <option key="0"/> #11                     
                <option key="0"/> #12                     
                <option key="0"/> #13                     
                <option key="0"/> #14                 
            </check>
        </row>
        <row>
            <cell>Phrase 1</cell> #0
            <check shuffle="False">
                <option key="1"/> #1
                <option key="0"/> #2
                <option key="0"/> #3
            </check>
            <cell>Phrase 2</cell> #4
            <check shuffle="False">
                <option key="1"/> #5
                <option key="0"/> #6
            </check>
            <cell>Phrase 3</cell> #7
        </row>
    </table>
    

    Output:

    <table>
        <row>
            <cell>Phrase 1</cell>0 #0                 
            <check shuffle="False">
                <option key="1"></option>1 #1                     
                <option key="0"></option>2 #2                     
                <option key="0"></option>3 #3                     
                <option key="0"></option>4 #4                     
                <option key="0"></option>5 #5                     
                <option key="0"></option>6 #6                 
            </check>
            <cell>Phrase 2</cell>7 #7                 
            <cell>Phrase 3</cell>8 #8                 
            <check shuffle="False">
                <option key="1"></option>9 #9                     
                <option key="0"></option>10 #10                     
                <option key="0"></option>11 #11                     
                <option key="0"></option>12 #12                     
                <option key="0"></option>13 #13                     
                <option key="0"></option>14 #14                 
            </check>
        </row>
        <row>
            <cell>Phrase 1</cell>0 #0
            <check shuffle="False">
                <option key="1"></option>1 #1
                <option key="0"></option>2 #2
                <option key="0"></option>3 #3
            </check>
            <cell>Phrase 2</cell>4 #4
            <check shuffle="False">
                <option key="1"></option>5 #5
                <option key="0"></option>6 #6
            </check>
            <cell>Phrase 3</cell>7 #7
        </row>
    </table>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Short: I need a right-click event to highlight the cell row. I am using
I need to add 'ADD NEW ROW' cell to the table. And I add
I want every cell in each row except the last in each row. I
I have a ComboBox inside of a cell of a DataGridView Row on a
I have a row of data that I need to modify in a database,
While estimating straight row and table sizes are fairly simple math, we find it
I got a row structure looks like ID bigint, ScanRept XML I want to
I want to put some background image for TableView row cell. I am using
How do you select the whole DataGridView row on cell select and disabling the
I'd like to find a cell in an Excel sheet by its text. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.