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 7607027
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T00:33:27+00:00 2026-05-31T00:33:27+00:00

I am using the below way to assign value to a variable. <xsl:variable name=NewValue>

  • 0

I am using the below way to assign value to a variable.

<xsl:variable name="NewValue">
  <xsl:value-of select="normalize-space(//root/id/amount)"/>
</xsl:variable>

After the assignment I want to assign new value to the same variable. Like this:-

<xsl:variable name="NewValue" select="normalize-space(//root/id/amountnew)">

Is there any way for this?


Here the sample of XML that I have:

<VolLien>
  <Vest_DocType>SDD</Vest_DocType>
  <Vest_Instrument>395072</Vest_Instrument>
  <Vest_OfOfficialEntity>eee</Vest_OfOfficialEntity>
  <Vest_RecDate>12/24/2009</Vest_RecDate>
  <Vest_Grantee1>abc dd</Vest_Grantee1>
  <Vest_Grantor1>sss</Vest_Grantor1>
  <Vest_RejectCode />
  <Vest_RejectReason /> 
  <Vest_ImageNum> </Vest_ImageNum>
</VolLien>

My problem is I need to get latest <Vest_RecDate> of particular <Vest_DocType>(say SDD) And then I need to search across the xml any date which is before <Vest_RecDate> of this(same SDD).

If then raise that particular section(<VolLien>) alone and again latest. If I could have reassignment I would position of the node and get the values associated to that. Now I am doing this using another loop. If something is there I can avoid extrs loops.

  • 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-31T00:33:28+00:00Added an answer on May 31, 2026 at 12:33 am

    No. XSLT variables are read-only. They cannot be assigned multiple times.

    XSLT is not an imperative programming language like, say, PHP. Reassigning variables is both impossible and unnecessary.


    EDIT: According to your comment:

    My problem is I need to get latest of particular <Vest_DocType> (say SDD) and then I need to search across the xml any date which is before <Vest_RecDate> of this (same SDD).

    here is an XSLT snippet that can do this for you:

    <!-- a key to retrieve all <VolLien> nodes of a particular DocType -->
    <xsl:key name="VolLien-by-DocType" match="VolLien" use="Vest_DocType" />
    
    <xsl:template match="/">
      <xsl:call-template name="latest-VolLien">
        <xsl:with-param name="DocType" select="'SDD'" />
      </xsl:call-template>
    </xsl:template>
    
    <!-- this template processes specified <VolLien> nodes in the right order -->
    <xsl:template name="latest-VolLien">
      <xsl:param name="DocType" select="''" />
    
      <xsl:for-each select="key('VolLien-by-DocType', $DocType)">
        <!-- sorting is a little complicated because you 
             use dd/mm/yyyy instead of yyyymmdd -->
        <xsl:sort 
          select="
            number(substring(Vest_RecDate, 7, 4)) + 
            number(substring(Vest_RecDate, 4, 2)) + 
            number(substring(Vest_RecDate, 1, 2))
          "
          data-type="number"
        />
        <!-- do something with last <VolLien> (in date order) -->
        <xsl:if test="position() = last()">
          <xsl:apply-templates select="." />
        </xsl:if>
      </xsl:for-each>
    </xsl:template>
    
    <xsl:template match="VolLien">
      <!-- this template will actually process the nodes,
           do whatever you want here -->
    </xsl:template>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i written code using for loop in 2 ways like below first way for(int
i am using below code to change the the font type of text view.
Currently i'm using below code which works well. $(#topperAtBaseLevel:visible, #lowerAtBaseLevel:visible, #midAtBaseLevel).hide(); any optimised code?
I am using below code to create a reminder in Google calendar (using Google
As of now I'm using below line to print with out dot's fprintf( stdout,
I have a class that I am using below. And I am using this
i want to implement next previous functionality using below function. - (void)motionEnded:(UIEventSubtype)mt withEvent:(UIEvent *)event
In past, I am using Listview and using below code can show a particular
I want to enable auto update script in flex3. i am using below code
I am actually having a list of text boxes. I am using below code

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.