Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

XSLT script not pulling values as expected from JSON - not being used correctly w /Root??

json0315.txtxsltscript.txt

Solved Solved
0 5 285
1 ACCEPTED SOLUTION

Hi Frank

I think you can get what you want with a series of xsl:if elements.

If I were you I might extract all the LoanTransactionDetails things into its own template. Like this:

        <xsl:apply-templates select="LoanTransactionDetails"/><br>

And then the template might be like this:

  <xsl:template match="LoanTransactionDetails">
    <soap:LoanTransactionDetails>
      <xsl:if test="procFile != ''">
        <soap:procFile><xsl:value-of select="procFile"/></soap:procFile>
      </xsl:if>
       ...
    </soap:LoanTransactionDetails>

  </xsl:template>

In my experience, XSL can be a challenge. You might want to try an interactive editor, like this one: https://xslttest.appspot.com/

(No affiliation)

View solution in original post

5 REPLIES 5