Comments (2)
Hi,
01: not sure what you mean, is the method tojson()
what you need?
02: you may use getattributes ( ref string as_names[] ) returns long
to get list of attributes (the object "keys")
03: you have to write a visitor to build the xml yourself, there is not automatic way available at know, may be a feature request?
from pbjson.
Hey @xlat thanks resolved however my code is as follows just check once if there is any improvement let me know, My requirement was to only display the report and not edit or update so this is ok for me also my array size is also limited.
int li_start, li_end, li_col_start, li_col_count
String ls_error, ls_response, ls_value, ls_attributes[], ls_key, ls_row
any la_data, la_contents[]
json ln_json, ln_item
ln_json = create json
ls_response = '{"contents": [{"id" : "1", "name" : "one"},{ "id" : "2", "name" : "Two"}]}'
ls_error = ln_json.parse(ls_response)
if ls_error = "" then
ln_json.retrieve("contents", ref la_data)
la_contents[] = la_data
li_end = upperbound( la_contents[] )
//MessageBox("Info", "Name : " + string(ln_item.getattribute("name")))
For li_start = 1 TO li_end
ln_item = la_contents[li_start]
ln_item.getattributes(ls_attributes)
li_col_count = upperbound( ls_attributes )
ls_row = ''
For li_col_start = 1 TO li_col_count
ls_key = ls_attributes[li_col_start]
ls_value = String(ln_item.getattribute(ls_attributes[li_col_start] ))
//MessageBox("Info", ls_key + " : " + ls_value)
ls_row = ls_row + ls_value
IF li_col_start < li_col_count THEN ls_row = ls_row + ','
NEXT
//Messagebox("row", ls_row)
write_log("d:\tss\output\report.csv", ls_row)
next
end if
destroy ln_json
from pbjson.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pbjson.