你在这里: JSON JSONFragmenter

JSONFragmenter

Extracts portions of JSON (JavaScript Object Notation) formatted text into new FME features.

Output Ports

Parameters

Flattening Parameters

JSON Queries

A JSON query is a simple mechanism to refer to values within a JSON document.一个查询是由一个或多个表达式,由+运算符分隔。There are three types of expressions: JSON structure expressions,JSON property expressions and string literal expressions.

JSON Structure Expressions

JSON结构表达式可以引用JSON文档中的值。The outermost JSON element,which must be an array or an object,总是用术语json来指代,and this term must appear at the beginning of every JSON structure expression.可以使用类似于javascript的方括号索引运算符来引用子元素。例如,如果最外面的元素是数组,the first element of the array can be referred to by the expression json[0],第二个元素可以由表达式json[1]引用,and so on.同样地,如果最外层的json元素是一个对象,用“name”和“address”键,然后,这些键的值可以分别由表达式json[“name”]和json[“address”]引用。

这些索引运算符可以层叠。例如,it the outermost JSON element is an object with a key and "address" whose value is an object containing keys "city" and "province",then these values can be referred to by the expressions json["address"]["city"] and json["address"]["province"].

为了引用数组或对象中的所有值,可以使用通配符索引*。例如,if the outermost JSON element is an array,then the expression json[*] refers to every element in the array.

JSON Property Expressions

属性表达式是如上所述的结构表达式,然后是A。(点)运算符和属性名。目前,唯一支持的属性是类型和大小。The type property returns the type of the JSON value referred to by the JSON structure expression.例如,if the outermost JSON element is an array,数组的第一个元素是一个字符串,then the expression json[0].type would have a value of string.The size property,只能应用于数组,returns the number of elements in the array.

字符串文字表达式

字符串文字表达式只是一个带引号的字符串值,例如“这是字符串文本表达式”。

FME Licensing Level

FME Professional edition and above

编辑变压器参数

Using a set of menu options,transformer parameters can be assigned by referencing other elements in the workspace.More advanced functions,such as an advanced editor and an arithmetic editor,在一些变压器中也有。To access a menu of these options,clickbeside the applicable parameter.For more information,看见Transformer Parameter Menu Options.

变压器类别

JSON

Search FME Knowledge Center

Search for samples and information about this transformer on theFME知识中心.

TagsKeywords: JSONExploder