xml2json

package module
v0.0.0-...-d725791 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 18, 2023 License: BSD-3-Clause Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Log

This activity allows you to convert XML data to JSON object.

Installation

Flogo CLI
flogo install github.com/project-flogo/contrib/activity/xml2json

Configuration

Input:
Name Type Description
xmlData string The XML data to be converted
Output:
Name Type Description
jsonObject object The JSON object

Examples

The below example logs a message 'test message':

{
  "id": "xml2json_activity",
  "name": "XML2JSON Activity",
  "activity": {
    "ref": "github.com/project-flogo/contrib/activity/xml2json",
    "input": {
      "xmlData": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><hello>world</hello>"
    }
  }
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Activity

type Activity struct {
}

Activity is an activity that converts XML data into JSON object. inputs: XML data outputs: JSON object

func (*Activity) Eval

func (a *Activity) Eval(context activity.Context) (done bool, err error)

func (*Activity) Metadata

func (a *Activity) Metadata() *activity.Metadata

Metadata returns the activity's metadata

type Input

type Input struct {
	XmlData interface{} `md:"xmlData"` //
}

func (*Input) FromMap

func (i *Input) FromMap(values map[string]interface{}) error

func (*Input) ToMap

func (i *Input) ToMap() map[string]interface{}

type Output

type Output struct {
	JsonObject map[string]interface{} `md:"jsonObject"` // The HTTP response data
}

func (*Output) FromMap

func (o *Output) FromMap(values map[string]interface{}) error

func (*Output) ToMap

func (o *Output) ToMap() map[string]interface{}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL