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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:25:43+00:00 2026-06-11T02:25:43+00:00

I’ve search for hours and not found an example that allows for the very

  • 0

I’ve search for hours and not found an example that allows for the very first position to be the lowest. I’m getting ‘False’ instead of the value returned ….

Example XML :

<?xml version="1.0"?>
<GetLowestOfferListingsForASINResponse xmlns="http://mws.amazonservices.com/schema/Products/2011-10-01">
  <GetLowestOfferListingsForASINResult ASIN="0470067802" status="Success">
    <AllOfferListingsConsidered>false</AllOfferListingsConsidered>
    <Product xmlns="http://mws.amazonservices.com/schema/Products/2011-10-01" xmlns:ns2="http://mws.amazonservices.com/schema/Products/2011-10-01/default.xsd">
      <LowestOfferListings>
        <LowestOfferListing>
          <Qualifiers>
            <ItemCondition>Used</ItemCondition>
            <ItemSubcondition>Good</ItemSubcondition>
          </Qualifiers>
          <Price>
            <LandedPrice>
              <Amount>15.71</Amount>
            </LandedPrice>
          </Price>
        </LowestOfferListing>
        <LowestOfferListing>
          <Qualifiers>
            <ItemCondition>Used</ItemCondition>
            <ItemSubcondition>Good</ItemSubcondition>
          </Qualifiers>
          <Price>
            <LandedPrice>
              <Amount>16.71</Amount>
            </LandedPrice>
          </Price>
        </LowestOfferListing>
        <LowestOfferListing>
          <Qualifiers>
            <ItemCondition>Used</ItemCondition>
            <ItemSubcondition>Good</ItemSubcondition>
          </Qualifiers>
          <Price>
            <LandedPrice>
              <Amount>18.71</Amount>
            </LandedPrice>
          </Price>
        </LowestOfferListing>
      </LowestOfferListings>
    </Product>
  </GetLowestOfferListingsForASINResult>
</GetLowestOfferListingsForASINResponse>

Example XSLT that doesn’t work correctly:

 <?xml version="1.0" encoding="utf-8"?>
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:amz="http://mws.amazonservices.com/schema/Products/2011-10-01" exclude-result-prefixes="amz">
 <xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes"/>
 <xsl:template match="/">
  <xsl:variable name="MIN_Landed">
   <xsl:for-each select="//Amount">
    <xsl:sort data-type="number" order="ascending"/>
    <xsl:if test="position()=1"><xsl:value-of select="."/></xsl:if>
   </xsl:for-each>
  </xsl:variable>
 <FMPXMLRESULT xmlns="http://www.filemaker.com/fmpxmlresult">
   <ERRORCODE>0</ERRORCODE>
   <PRODUCT BUILD="" NAME="" VERSION=""/>
   <DATABASE DATEFORMAT="M/d/yyyy" LAYOUT="" NAME="" RECORDS="1" TIMEFORMAT="h:mm:ss a"/>
   <METADATA>
      <FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="DATA" TYPE="TEXT"/>
      <FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="Min_Landed" TYPE="TEXT"/>
   </METADATA>
   <RESULTSET>
      <xsl:attribute name="FOUND">1</xsl:attribute>
      <xsl:for-each select="amz:GetLowestOfferListingsForASINResponse/amz:GetLowestOfferListingsForASINResult/amz:Product/amz:LowestOfferListings/amz:LowestOfferListing">
           <ROW>
                <xsl:attribute name="MODID">0</xsl:attribute>
                <xsl:attribute name="RECORDID">1</xsl:attribute>
                <COL>
                     <DATA>
                          <xsl:value-of select="amz:Qualifiers/amz:ItemCondition"/>
                     </DATA>
                </COL>
                <COL>
                     <DATA>
                          <xsl:value-of select="$MIN_Landed"/>
                     </DATA>
                </COL>
           </ROW>
      </xsl:for-each>
    </RESULTSET>
   </FMPXMLRESULT>
  </xsl:template>
</xsl:stylesheet>

HELP PLEASE!

I really didn’t want to post so much Amazon code but here it is stripped down to a bare bones response

APPARENTLY the order matters ……

Example XSLT that does work:

 <?xml version="1.0" encoding="utf-8"?>
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:amz="http://mws.amazonservices.com/schema/Products/2011-10-01" exclude-result-prefixes="amz">
 <xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes"/>
 <xsl:template match="/">
  <xsl:variable name="MIN_Landed">
   <xsl:for-each select="//Amount">
    <xsl:sort data-type="number" order="ascending"/>
    <xsl:if test="position()=1"><xsl:value-of select="."/></xsl:if>
   </xsl:for-each>
  </xsl:variable>
 <FMPXMLRESULT xmlns="http://www.filemaker.com/fmpxmlresult">
   <ERRORCODE>0</ERRORCODE>
   <PRODUCT BUILD="" NAME="" VERSION=""/>
   <DATABASE DATEFORMAT="M/d/yyyy" LAYOUT="" NAME="" RECORDS="1" TIMEFORMAT="h:mm:ss a"/>
   <METADATA>
      <FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="DATA" TYPE="TEXT"/>
      <FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="Min_Landed" TYPE="TEXT"/>
   </METADATA>
   <RESULTSET>
      <xsl:attribute name="FOUND">1</xsl:attribute>
      <xsl:for-each select="amz:GetLowestOfferListingsForASINResponse/amz:GetLowestOfferListingsForASINResult/amz:Product/amz:LowestOfferListings/amz:LowestOfferListing">
           <ROW>
                <xsl:attribute name="MODID">0</xsl:attribute>
                <xsl:attribute name="RECORDID">1</xsl:attribute>
                <COL>
                     <DATA>
                          <xsl:value-of select="$MIN_Landed"/>
                     </DATA>
                </COL>
                <COL>
                     <DATA>
                          <xsl:value-of select="amz:Qualifiers/amz:ItemCondition"/>
                     </DATA>
                </COL>
           </ROW>
      </xsl:for-each>
    </RESULTSET>
   </FMPXMLRESULT>
  </xsl:template>
</xsl:stylesheet>
  • 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-06-11T02:25:45+00:00Added an answer on June 11, 2026 at 2:25 am

    It pays to show the code you’re actually working with, or at least a facsimile that presents all possible factors, like namespaces. Swap this in:

    <xsl:for-each select="//amz:Amount">
    

    If this doesn’t fix it, there is a problem external to your xsl. This works against the source you’ve provided.


    Archive

    Your example doesn’t show where your code sits within your XSL, nor is it clear whether or not every Amount in the source document always sits below one each of a,b,c,d,e,f,Price elements or if there is a root element, and if so, what that is. Your code also doesn’t close the variable tag nor show how the variable is being outputted.

    Assuming there is nothing going wrong with any of the above, your ‘order’ attribute should be ascending, since with position() = '1', you are seeking the node at the top position after sorting. Ascending puts the lowest value first.

    The following code by itself will output the min value in your source document regardless of the source document structure:

    <xsl:template match="/">
        <xsl:variable name="MIN_Landed">
            <xsl:for-each select="//Amount">
                <xsl:sort data-type="number" order="ascending"/>
                <xsl:if test="position()=1">
                    <xsl:value-of select="."/>
                </xsl:if>
            </xsl:for-each>
        </xsl:variable>
        <xsl:value-of select = "$MIN_Landed" />
    </xsl:template>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I am doing a simple coin flipping experiment for class that involves flipping a

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.