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

  • SEARCH
  • Home
  • 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 6739587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:30:23+00:00 2026-05-26T11:30:23+00:00

if suppose my database having three row records by fetching that data i am

  • 0

if suppose my database having three row records by fetching that data i am converting into xml data as shown below :

Here is my XML:

<NewDataSet>
 <Table>
<RECORD_TYPE_CODE>CTD</RECORD_TYPE_CODE>
<MSG_TYPE_CODE>O103N</MSG_TYPE_CODE>
<CTD_SEQ_NUM>000086</CTD_SEQ_NUM>   
<CTD_CTD_PKG_ID>2</CTD_CTD_PKG_ID>
</Table>
<Table>
<RECORD_TYPE_CODE>CTO</RECORD_TYPE_CODE>
<MSG_TYPE_CODE>O203N</MSG_TYPE_CODE>
<CTD_SEQ_NUM>000087</CTD_SEQ_NUM>   
<CTD_CTD_PKG_ID>2</CTD_CTD_PKG_ID>
</Table>
<Table>
<RECORD_TYPE_CODE>CTH</RECORD_TYPE_CODE>
<MSG_TYPE_CODE>O303N</MSG_TYPE_CODE>
<CTD_SEQ_NUM>000088</CTD_SEQ_NUM>   
<CTD_CTD_PKG_ID>2</CTD_CTD_PKG_ID>   
</Table>
</NewDataSet>

through c sharp code behind using for loop i m sending package id (CTD_CTD_PKG_ID)and Sequencenum(CTD_SEQ_NUM) through xslt argument parameters it was passing properly in a sequential order like 000086,000087,000088 but first time for in aloop i will pass 000086 seqnum it was fetching proper manner next when i m passing 000087 it was generating data in table of 000086 only why it was happening passing parameter value is goin good in a sequential order

here is my XSLT:

    <xsl:param name="PackageId"  />
<xsl:param name="SequenceNum"  />
<xsl:template match="/">
<xsl:apply-templates mode="SequenceB"  select="(NewDataSet/Table[CTD_CTD_PKG_ID =$PackageId]    |   NewDataSet/Table[CTD_SEQ_NUM =$SequenceNum])[1]"/>
</xsl:template>
  • 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-26T11:30:24+00:00Added an answer on May 26, 2026 at 11:30 am

    I guess (if my guess is incorrect, you need to explain better the problem) that the value of your $PackageId parameter is always defined as 2.

    The XPath expression you are using:

        (NewDataSet/Table[CTD_CTD_PKG_ID =$PackageId]
       |
         NewDataSet/Table[CTD_SEQ_NUM =$SequenceNum]
         )
         [1]
    

    selects the first node from the union of the nodes selected by:

    NewDataSet/Table[CTD_CTD_PKG_ID =$PackageId]
    

    and:

    NewDataSet/Table[CTD_SEQ_NUM =$SequenceNum]
    

    Do note, that if the value of the $PackageId parameter is 2, then the first node of theis union is always /*/Table[1].

    The solution is to replace the XPath expression you are using with:

    NewDataSet/Table[CTD_CTD_PKG_ID =$PackageId][CTD_SEQ_NUM =$SequenceNum]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have an application that takes real time data and inserts it into database.
I'm having trouble retrieving data from my database using Spring Jdbc. Here's my issue:
Suppose I have a database table that has a timedate column of the last
Suppose I have a table in my database that is made up of the
Suppose I am having three dropdownlist controls named dd1 , dd2 and dd3 .
Suppose a database table has a column Name which is defined as key for
Suppose I have a database table with two fields, foo and bar. Neither of
Suppose I have a database table with columns a, b, and c. I plan
Suppose I have a database like this: This is set up to give role-wise
Suppose you are implementing a publication database and creating migrations to represent different publications.

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.