0

Hi in below xml format i want to get the count of S_fin nodes where F_ba date node is less than 18 monthns of current date. i have a function to get date diffrence here i just want to get the count of nodes which satisfy the conditon.

    <Root>
    <S_fin>
    <FS_ba>
      <F_ba>2013-10-29</F_ba>
      <F_BD desc="Fiscal">001</F_BD>
      <F_BF desc="Thousands">001</F_BF>
      <F_BG desc="Indian Rupee">9</F_BG>
    </FS_ba>
  </S_fin>
  <S_fin>
    <FS_ba>
      <F_ba>2012-10-29</F_ba>
      <F_BD desc="Fiscal">001</F_BD>
      <F_BF desc="Thousands">001</F_BF>
      <F_BG desc="Indian Rupee">9</F_BG>
    </FS_ba>
  </S_fin>
  <S_fin>
    <FS_ba>
        <F_ba>2011-10-29</F_ba>
      <F_BD desc="Fiscal">001</F_BD>
      <F_BF desc="Thousands">001</F_BF>
      <F_BG desc="Indian Rupee">9</F_BG>
    </FS_ba>
  </S_fin>
 <S_fin>
    <FS_ba>
      <F_ba>2013-10-29</F_ba>
      <F_BD desc="Fiscal">001</F_BD>
      <F_BF desc="Thousands">001</F_BF>
      <F_BG desc="Indian Rupee">9</F_BG>
    </FS_ba>
  </S_fin>
</Root>
1
  • 1
    XSLT 1.0 doesn't have any date functions itself, so are you using an extension function here? It would help if you showed any XSLT you currently have (especially an example of your date difference function). Showing your expected output would also help. Thank you! Commented Dec 8, 2014 at 8:31

1 Answer 1

1

In xslt it will look like that.

Add reference to your function in square brackets instead of checking for non-empty

    <xsl:template match="@* | node()">
          <cnt>
            <xsl:value-of select="count(S_fin[FS_ba/F_ba != ''])"/>
          </cnt>
     </xsl:template>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.