Supported in: Batch, Streaming
Parses xml strings following the given schema definition, ignoring any fields not in the schema.
Expression categories: File, Struct
Output type: Struct
Argument values:
xml
xml | Output |
---|---|
<airline> <id>XB-112</id> <airport> <id>JFK</id> <miles>2000</miles> </airport> </airline> | { airport: { id: JFK, miles: 2000, }, id: XB-112, } |
Description: When a requested field is missing in the input XML the field becomes null. Argument values:
xml
xml | Output |
---|---|
<airline> <id>XB-112</id> <airport> <id>JFK</id> </airport> </airline> | { airport: { id: JFK, miles: null, }, id: XB-112, } |
Description: When the requested schema is too small, only the fields in the schema are parsed. Argument values:
xml
xml | Output |
---|---|
<airline> <id>XB-112</id> <airport> <id>JFK</id> </airport> </airline> | { id: XB-112, } |
Description: You can read attributes by putting attribute prefix in front of the name. Argument values:
xml
xml | Output |
---|---|
<airline> <id>XB-112</id> <airport id="JFK"> <miles>2000</miles> </airport> </airline> | { airport: { _id: JFK, miles: 2000, }, id: XB-112, } |