You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

xml to json conversion using XSLT template using ICS

edited Jan 31, 2018 8:00AM in Integration 13 comments

Summary

xml to json conversion using XSLT template using ICS

Content

Hi Team,

The below mentioned XSLT  converts xml to json:

<?xml version="1.0"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="text"/>

<xsl:template match="/">{

    <xsl:apply-templates select="*"/>}

</xsl:template>

<!-- Object or Element Property-->

<xsl:template match="*">

    "<xsl:value-of select="name()"/>" :<xsl:call-template name="Properties">

        <xsl:with-param name="parent" select="'Yes'"> </xsl:with-param>

    </xsl:call-template>

</xsl:template>

<!-- Array Element -->

<xsl:template match="*" mode="ArrayElement">

    <xsl:call-template name="Properties"/>

</xsl:template>

<!-- Object Properties -->

<xsl:template name="Properties">

    <xsl:param name="parent"></xsl:param>

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!