Jump to content

json data in xml-tag


franxic

Recommended Posts

Hi there,

I want to evaluate a json-array that is stored inside a xml-file, e.g.:

<club>Real Madrid</club>

<json_members>{members:[{member_name:sergio,member_since:2010},{member_name:alonso,member_since:2007}]}</json_members>

I need to do that this way because the internet gateway our company uses does not support filling the database with an unknown number of datafields.

Any help is appreciated.

Regards, Frank

 

Link to comment
Share on other sites

  • 5 weeks later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

The algorithm is this: retrieve the substring beginning with "members" from xml, take it as JSON data and parse it as a two-dimensional table. It is complicated to write a report script to code this. An alternative is to first parse JSON using esProc import@j() function and then use the report to access the esProc code via JDBC. Below is the code:

A1=file("d:\source.txt").read()

A2=pos(A1,"{members")

A3=pos(A1,"</json_members>")

A4=mid(A1,A2,A3-A2)

A5=A4.import@j().members  

You can find more examples in http://blog.raqsoft.com/?p=4679 .

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...