시간이 많이 걸렸으므로 맨 처음 위치가 가장 낮은 위치를 찾지 못하는 예제는 없습니다. 나는XSLT ... XML에서 최소값을 찾고 변수를 설정할 수 없습니다.
예 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>
예 XSLT를 제대로 작동하지 않는 :
<?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>
도와주세요!
정말 작업을 수행하는
예 XSLT ......이 노출 된 뼈은 응답
분명히 주문 사항에 벗었 여기에 너무 많은 아마존 코드를 게시하고 싶지만하지 않았다 :
<?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>
질문에는 질문, 예상 출력이 기재되어 있지 않은. 귀하의 질문은 무엇인가? –
반복적이었습니다. 그의 문제는 해결되었습니다. –