<?xml version="1.0" encoding="UTF-8" ?> 
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:extensions="urn:fnplm:lmadmin" xmlns:fnplm="urn:fnplm:lmadmin" xmlns:xalan="http://xml.apache.org/xalan" exclude-result-prefixes="extensions">
<xsl:output method="xml" version="4.01" encoding="UTF-8" omit-xml-declaration="yes"/>
<xsl:output indent="yes"/>
<xsl:param name="fulfillmentid" select="''"/>
<xsl:param name="productid" select="'EZCALC'"/>

<xsl:template match="xml">
<xsl:variable name="totalRecords" select="count(//fnplm:fulfillments/*)"/>
    <xml>
        <xsl:apply-templates select="fnplm:fulfillments"/>
        <fnplm:input> 
          <xsl:attribute name="pageOffset">
               <xsl:value-of select="0"/>
          </xsl:attribute>
          <xsl:attribute name="pageSize">
               <xsl:value-of select="$totalRecords"/> 
          </xsl:attribute>
          <xsl:attribute name="totalRecords">
               <xsl:value-of select="$totalRecords"/> 
          </xsl:attribute>
          <xsl:attribute name="search">
               <xsl:value-of select="$fulfillmentid"/> 
          </xsl:attribute>
        </fnplm:input> 
    </xml>
</xsl:template>

<xsl:template match="fnplm:fulfillments">
    <fnplm:fulfillments>
            <xsl:copy-of select="@*"/>
            <xsl:apply-templates select="fnplm:fulfillment[contains(translate(@fulfillmentid,'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ'), translate($fulfillmentid, 'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'))]"/> 
    </fnplm:fulfillments>
</xsl:template>

<xsl:template match="fnplm:fulfillment">
        <fnplm:fulfillment>
            <xsl:copy-of select="@*"/>
        </fnplm:fulfillment>
</xsl:template>
</xsl:stylesheet>
