Update 23 Jun 2020: Add new parameter arrayGPathList to force JSON output in arrays using GPath notation
Update 5 Nov 2019: Add new parameter trim to trim XML text nodes
Update 1 May 2019: Add new parameter fieldConversions to generate output other than String
Update 2 Nov 2018: Default parsing in CPI will be using SAX-based XmlSlurper
Update 4 Sep 2018: Now available in CPI as well.
Update 31 Mar 2016: Enhancement to support forcing of JSON output in arrays irrespective of number of values in payload with new parameters forceArrayAll or arrayFieldList
Update 25 Mar 2015: JSONTransformBeanBean has been refactored to be part of FormatConversionBean. Parameter conversionType replaced with converterClass. Note that some of the screenshots are not updated to reflect the new parameter converterClass
Number | Module Name | Type | Module Key |
---|---|---|---|
<Depending on position of module in chain> 1) Asynchronous scenario, Normally before the last module in channels 2) Synchronous scenario, Before last module to convert request payload After last module to convert response payload | Custom_AF_Modules/FormatConversionBean | Local Enterprise Bean | <Any Arbitrary Value> |
Parameter Name | Allowed values | Default value | Remarks |
---|---|---|---|
converterClass | PI - com.equalize.xpi.af.modules.json.XML2JSONConverter CPI - com.equalize.converter.core.XML2JSONConverter | Required field. Determines conversion class | |
indentFactor | Integer values beginning from 1 | 0 | Determines the number of indentation spaces for each level in the JSON output. Note: When indentation is not used, the JSON content produced is compact and ideal for lightweight data transfer |
skipRootNode | Y,N | N | Skips root XML element in JSON output |
forceArrayAll | Y,N | N | Forces all nodes and fields to be in JSON Array |
arrayFieldList | Comma separated values of field names to be forced as JSON Array. Example: field1,field2,field3 | ||
arrayGPathList | Available only in CPI Comma separated values of field names to be forced as JSON Array. This uses GPath notation based on the target JSON structure Example: field1,parent.field2,parent.child.field3 | ||
useDOM | Y, N | N | Available only in CPI Parser used in parsing input XML
|
trim | Y, N | N | Available only in CPI Trim whitespace in XML text nodes during parsing |
fieldConversions | Available only in CPI Comma separated values of field names to be generated as a different type. Each entry is a key-value pair separated by colon (:) Supported types are: number, null, boolean Example: field1:number,field2:null,field3:boolean | ||
messageLog | pre, post | Saves a log version of the message that is viewable in Message Monitor
Available only in PI | |
logLocation | Name of log version when messageLog is populated. Location defaulted to value in messageLog if logLocation not populated. Available only in PI |
Parameter Name | Parameter Value |
---|---|
converterClass | com.equalize.xpi.af.modules.json.XML2JSONConverter |
skipRootNode | Y |
indentFactor | 2 |
Input | <?xml version="1.0" encoding="UTF-8" standalone="no"?> <ns:MT_XML2JSON xmlns:ns="urn:equalize:com"> <glossary> <title>example glossary</title> <GlossDiv> <GlossList> <GlossEntry> <SortAs>SGML</SortAs> <GlossDef> <GlossSeeAlso>GML</GlossSeeAlso> <GlossSeeAlso>XML</GlossSeeAlso> <para>A meta-markup language, used to create markup languages such as DocBook.</para> </GlossDef> <GlossTerm>Standard Generalized Markup Language</GlossTerm> <GlossSee>markup</GlossSee> <ID>SGML</ID> <Acronym>SGML</Acronym> <Abbrev>ISO 8879:1986</Abbrev> </GlossEntry> </GlossList> <title>S</title> </GlossDiv> </glossary> </ns:MT_XML2JSON> |
Output |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
36 | |
8 | |
7 | |
5 | |
5 | |
4 | |
4 | |
4 | |
3 | |
3 |