none
Scripting functoid problem in EDI 852 to xml Conversion.. RRS feed

  • Question

  • Hi Experts,

                 I need to populate DetailsRecord for that I wrote XSLt template  which is given below:

    <xsl:template name="DetailsRecord1">
        <xsl:param name="NDCCode"/>
        <xsl:param name="UOM"/>
        <xsl:param name="QType"/>
        <xsl:param name="Qty"/>
        <xsl:variable name="VarQtype_QA" select="CurrentInventoryQtyAvailableForShipment"/>
        <xsl:variable name="VarQtype_QS" select="QuantityOnOrder_NotYetReceived"/>
        <xsl:variable name="VarQtype_QP" select="QuantityOnOrder"/>
        <xsl:element name="DetailsRecord">
          <xsl:element name="NDCCode">
            <xsl:value-of select="$NDCCode"/>
          </xsl:element>
          
            <xsl:element name="UOM">
              <xsl:value-of select="$UOM"/>
            </xsl:element>
          <xsl:choose>
            <xsl:when test="$QType='QA' or $QType='QS' or 'QP'">
              <xsl:if test="$QType='QA'">
                <xsl:element name="QunatityType">
                  <xsl:value-of select="$VarQtype_QA"/>
                   </xsl:element>
                <xsl:element name="Quantity">
                  <xsl:value-of select="$Qty"/>
                </xsl:element>
              </xsl:if>
              <xsl:if test="$QType='QS'">
                <xsl:element name="QunatityType">
                  <xsl:value-of select="$VarQtype_QS"/>
                </xsl:element>
                <xsl:element name="Quantity">
                  <xsl:value-of select="$Qty"/>
                </xsl:element>
              </xsl:if>
              <xsl:if test="$QType='QP'">
                <xsl:element name="QunatityType">
                  <xsl:value-of select="$VarQtype_QP"/>
                </xsl:element>
                <xsl:element name="Quantity">
                  <xsl:value-of select="$Qty"/>
                </xsl:element>
              </xsl:if>
            </xsl:when>
          </xsl:choose>
          
        </xsl:element>
        
        
      </xsl:template>

         Only populating  UOM and NDCCode  but not populating values from Choose Function


            


    Chittidi


    • Edited by Chittidi Thursday, July 21, 2016 6:09 PM as
    Thursday, July 21, 2016 6:05 PM

Answers

  • Hi,

    Not sure if it is typo,

     <xsl:when test="$QType='QA' or $QType='QS' or 'QP'">

    should be

     <xsl:when test="$QType='QA' or $QType='QS' or $QType='QP'">

    other part is instead of assigning value to element of variable try to create node structure and then use the select to get its node or element value.

    ParentNode

    ----QuantityType

    ----Quantity

    EndParentNode

    I had the similar issue and I have resolved it with creating the node structure instead of using directly through Variable.

    Hope this Helps!!!!

    Please Mark as Answered if you satisfy with Reply.

    • Proposed as answer by vikas.a.mehta Friday, July 22, 2016 5:58 AM
    • Marked as answer by Angie Xu Thursday, July 28, 2016 1:13 AM
    Friday, July 22, 2016 5:58 AM

All replies

  • Hi,

    Not sure if it is typo,

     <xsl:when test="$QType='QA' or $QType='QS' or 'QP'">

    should be

     <xsl:when test="$QType='QA' or $QType='QS' or $QType='QP'">

    other part is instead of assigning value to element of variable try to create node structure and then use the select to get its node or element value.

    ParentNode

    ----QuantityType

    ----Quantity

    EndParentNode

    I had the similar issue and I have resolved it with creating the node structure instead of using directly through Variable.

    Hope this Helps!!!!

    Please Mark as Answered if you satisfy with Reply.

    • Proposed as answer by vikas.a.mehta Friday, July 22, 2016 5:58 AM
    • Marked as answer by Angie Xu Thursday, July 28, 2016 1:13 AM
    Friday, July 22, 2016 5:58 AM
  • If you're using an Xslt Template, the Looping Functoid should not be necessary.
    Friday, July 22, 2016 12:51 PM