Skip to content

Instantly share code, notes, and snippets.

@ApigeeSamples
Created May 7, 2012 07:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ApigeeSamples/2626512 to your computer and use it in GitHub Desktop.
Save ApigeeSamples/2626512 to your computer and use it in GitHub Desktop.
XML to JSON
<XMLToJSON name="mypolicy">
<Source>request</Source>
<OutputVariable>response</OutputVariable>
<Options>
<RecognizeNumber>true</RecognizeNumber>
<RecognizeBoolean>true</RecognizeBoolean>
<RecognizeNull>true</RecognizeNull>
<NullValue>NULL</NullValue>
<NamespaceSeparator>%</NamespaceSeparator>
<NamespaceBlockName>#namespaces</NamespaceBlockName>
<DefaultNamespaceNodeName>&</DefaultNamespaceNodeName>
<TextAlwaysAsProperty>false</TextAlwaysAsProperty>
<TextNodeName>TEXT</TextNodeName>
<AttributeBlockName>ATT_BLOCK</AttributeBlockName>
<AttributePrefix>@</AttributePrefix>
<OutputPrefix>PREFIX_</OutputPrefix>
<OutputSuffix>_SUFFIX</OutputSuffix>
</Options>
</XMLToJSON>
<!--Note that you can use format definition to configure the options. The format definition contains all the <options> elements mentioned in the above example (see the below example).-->
<XMLToJSON name="mypolicy">
<Source>request</Source>
<OutputVariable>response</OutputVariable>
<Format>myFormat</Format>
</XMLToJSON>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment