locked
Xslt Add Same Node. RRS feed

  • Question

  • Hi All,

            How Add two value in Same Node Name. Please Help me.

    Example ;

    <ADD

    >

    <ST Value1="100" Value2="200

    "/>

     <ST Value1="300" Value2="400"/> 

    </ADD>

     


    I want (Value1 + Value1) * (Value2 + Value2).

    • Edited by Ashiknoor Tuesday, November 15, 2011 8:10 AM
    Tuesday, November 15, 2011 7:53 AM

Answers

  • <xsl:template match="ADD">

      <xsl:variable name="v" select="sum(ST/@Value1) * sum(ST/Value2)"/>

    </xsl:template>


    MVP Data Platform Development My blog
    • Marked as answer by Ashiknoor Tuesday, November 22, 2011 11:09 AM
    • Unmarked as answer by Ashiknoor Friday, November 25, 2011 10:59 AM
    • Marked as answer by Ashiknoor Friday, November 25, 2011 10:59 AM
    Tuesday, November 15, 2011 10:57 AM
  • Thanks Martin This one working well
    • Marked as answer by Ashiknoor Friday, November 25, 2011 10:58 AM
    Tuesday, November 22, 2011 11:09 AM
  • Consider to start a new thread for a new question next time.

    As for analyze-string, that is part of XSLT 2.0. Microsoft does not have any support for XSLT 2.0, if you want to use XSLT 2.0 then you need to use a third party product like AltovaXML, Saxon 9 or XQSharp.


    MVP Data Platform Development My blog
    • Marked as answer by Ashiknoor Saturday, November 26, 2011 10:26 AM
    Friday, November 25, 2011 11:49 AM

All replies

  • <xsl:template match="ADD">

      <xsl:variable name="v" select="sum(ST/@Value1) * sum(ST/Value2)"/>

    </xsl:template>


    MVP Data Platform Development My blog
    • Marked as answer by Ashiknoor Tuesday, November 22, 2011 11:09 AM
    • Unmarked as answer by Ashiknoor Friday, November 25, 2011 10:59 AM
    • Marked as answer by Ashiknoor Friday, November 25, 2011 10:59 AM
    Tuesday, November 15, 2011 10:57 AM
  • Thanks Martin This one working well
    • Marked as answer by Ashiknoor Friday, November 25, 2011 10:58 AM
    Tuesday, November 22, 2011 11:09 AM
  • Hi Martin.

                   <xsl:analyze-string   this Name  I can't see xslt.

    how is do this name please help me

    Friday, November 25, 2011 10:24 AM
  • Consider to start a new thread for a new question next time.

    As for analyze-string, that is part of XSLT 2.0. Microsoft does not have any support for XSLT 2.0, if you want to use XSLT 2.0 then you need to use a third party product like AltovaXML, Saxon 9 or XQSharp.


    MVP Data Platform Development My blog
    • Marked as answer by Ashiknoor Saturday, November 26, 2011 10:26 AM
    Friday, November 25, 2011 11:49 AM