goxml2json
goxml2json copied to clipboard
XML to JSON converter written in Go (no schema, no structs)
[Fixed Issue](https://github.com/basgys/goxml2json/issues/30)
``` if IsArrayTrue { xj.NodePlugin("x.y", xj.ToArray()) // how to add this line to xj.WithNodes(...) } jsn, err := xj.Convert(bytes.NewReader(xmlByte), xj.WithNodes( xj.NodePlugin("foo.bar", xj.ToArray()), ) ```
xml := strings.NewReader(`19.95`) json, err := xj.Convert(xml, xj.WithTypeConverter(xj.Float)) if err != nil { panic("That's embarrassing...") } fmt.Println(json.String()) // {"price": 19.95} why i can't uses xj.WithTypeConverter and xj.Float and how can...
Version Used: 1.1.0 XML to Parse: `XML start 04/06/22 09:24 987654321 Thank you, O:  13 Ext. 20601 M: 12 Sx:  qw Cl:  ui K:  [email protected]          End of message XML` Troubleshooting steps : Used...
Using #23 to force array, undefined error too many arguments in call to xml2json.Convert ```Go json, err := xj.Convert(reader, xj.WithNodes( xj.NodePlugin(CaseFileEventStatementsPath, xj.ToArray()), xj.NodePlugin(CaseFileOwnersPath, xj.ToArray()), xj.NodePlugin(CaseFileStatements, xj.ToArray()), xj.NodePlugin(MadridInternationalFilingRecordPath, xj.ToArray()), xj.NodePlugin(DesignSearchesPath, xj.ToArray()),...
As of now we cannot remove ```attrPrefix``` and ```contentPrefix``` by setting them to a blank string as the decoder checks on that and defaults to their const ```attrPrefix``` and ```contentPrefix```...
Hi, is it possible for force an array? For example i have the following xml: ````xml App One App Two App Three ```` which converts to ````json { "rss": {...
1. Looks up every path not just first 2. Indicates the child not the parent for which you want to wrap into array (allows selectivity).
This small patch add support for a new JS type `Null` which accepts the following values as JSON `null`: * the empty string; * the `null` and `nil` strings; *...