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

The Archive Base Latest Questions

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

I have a xml given below: <root title=الصفحة الرئيسة> <item title=الصفحة الرئيسة itemuri=tcm:8-29-4 ShowInNav=True

  • 0

I have a xml given below:

<root title='الصفحة الرئيسة'>    <item title='الصفحة الرئيسة' itemuri='tcm:8-29-4' ShowInNav='True' type='sg' pageuri='tcm:8-10592-64' sLink='/ara/index.aspx'>       <item title='من نحن' itemuri='tcm:8-779-4' ShowInNav='True' type='sg' pageuri='tcm:8-9934-64' navorder='00500' sLink='/ara/about/index.aspx'>       </item>       <item title='برامجنا' itemuri='tcm:8-817-4' ShowInNav='True' type='sg' pageuri='tcm:8-10112-64' navorder='00100' sLink='/ara/courses/language-study-abroad.aspx'>       </item>       <item title='مدارسنا' itemuri='tcm:8-824-4' ShowInNav='True' type='sg' pageuri='tcm:8-10162-64' navorder='00300' sLink='/ara/schools/english-language.aspx'>        </item>     </item> </root> 

Now I want to the value of maximum navorder, so that I can use that value further in ‘if‘ condition.

  • 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. 2026-05-11T00:27:41+00:00Added an answer on May 11, 2026 at 12:27 am

    Below is the XSLT 1.0 code of two possible solutions.

    A third solution is to use EXSLT.

    A fourth solution is to use the maximum template of FXSL.

    <xsl:stylesheet version='1.0'  xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>  <xsl:output method='text'/>      <xsl:template match='/'>       <xsl:variable name='vMax1' select=        '*/*/*/@navorder[not(. &lt; ../../*/@navorder)][3]'/>         $vMax1: <xsl:value-of select='$vMax1'/>        <xsl:variable name='vMax2'>         <xsl:call-template name='max'>           <xsl:with-param name='pSeq'                 select='*/*/*/@navorder'/>         </xsl:call-template>       </xsl:variable>         $vMax2: <xsl:value-of select='$vMax2'/>      </xsl:template>      <xsl:template name='max'>       <xsl:param name='pSeq'/>        <xsl:variable name='vLen' select='count($pSeq)'/>        <xsl:if test='$vLen > 0'>         <xsl:choose>           <xsl:when test='$vLen = 1'>             <xsl:value-of select='$pSeq[1]'/>           </xsl:when>           <xsl:otherwise>             <xsl:variable name='vHalf'               select='floor($vLen div 2)'/>              <xsl:variable name='vMax1'>               <xsl:call-template name='max'>                 <xsl:with-param name='pSeq'                   select='$pSeq[not(position() > $vHalf)]'/>               </xsl:call-template>             </xsl:variable>              <xsl:variable name='vMax2'>               <xsl:call-template name='max'>                 <xsl:with-param name='pSeq'                   select='$pSeq[position() > $vHalf]'/>               </xsl:call-template>             </xsl:variable>              <xsl:choose>               <xsl:when test='$vMax1 >= $vMax2'>                 <xsl:value-of select='$vMax1'/>               </xsl:when>               <xsl:otherwise>                 <xsl:value-of select='$vMax2'/>               </xsl:otherwise>             </xsl:choose>           </xsl:otherwise>         </xsl:choose>       </xsl:if>     </xsl:template> </xsl:stylesheet> 

    When the above transformatio is applied on the original XML document:

    <root title='الصفحة الرئيسة'>     <item title='الصفحة الرئيسة' itemuri='tcm:8-29-4'           ShowInNav='True' type='sg'           pageuri='tcm:8-10592-64'           sLink='/ara/index.aspx'>         <item title='من نحن' itemuri='tcm:8-779-4'               ShowInNav='True' type='sg'               pageuri='tcm:8-9934-64'               navorder='00500'               sLink='/ara/about/index.aspx'/>         <item title='برامجنا' itemuri='tcm:8-817-4'               ShowInNav='True' type='sg'               pageuri='tcm:8-10112-64'               navorder='00100'               sLink='/ara/courses/language-study-abroad.aspx'/>         <item title='مدارسنا' itemuri='tcm:8-824-4'               ShowInNav='True' type='sg'               pageuri='tcm:8-10162-64'               navorder='00300'               sLink='/ara/schools/english-language.aspx'/>   </item> </root> 

    the wanted result is produced:

       $vMax1: 00500     $vMax2: 00500 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 66k
  • Answers 66k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer The compiler doesn't know. If you cast -5 to unsigned… May 11, 2026 at 11:35 am
  • added an answer Since asking the question, I've learned a bit more about… May 11, 2026 at 11:35 am
  • added an answer sortUsingFunction: is an NSMutableArray method that re-orders the array object… May 11, 2026 at 11:35 am

Related Questions

I have a xml given below: <root title=الصفحة الرئيسة> <item title=الصفحة الرئيسة itemuri=tcm:8-29-4 ShowInNav=True
I have a Java object which is able to configure itself given an XML
Say I have this given XML file: <root> <node>x</node> <node>y</node> <node>a</node> </root> And I
I have rather large input XML files that must be converted to a given
I have a xml blob that's checked against a schema in sql 2005. My
I have a xml which is max 3 levels deep. Now by using C#
I have a XML schema that I will need to create Java classes for.
I have a XML Structure that looks like this. <sales> <item name=Games sku=MIC28306200 iCat=28
I have a XML File like that <?xml version=1.0 encoding=utf-8 ?> <Configurations> <EmailConfiguration> <userName>xxxx</userName>
Say I have a xml document that looks like this <foo> <bar id=9 />

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.