playMaker

Author Topic: DataMaker Xml xPath and Json [ECOSYSTEM] [FEBRUARY 2022]  (Read 66377 times)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15594
  • Official Playmaker Support
Re: DataMaker Xml xPath and Json [JANUARY 2016]
« Reply #45 on: February 03, 2016, 06:22:46 AM »
Hi,

What are the datamaker and arraymaker versions that works?

Bye,

 Jean

memetic arts

  • Full Member
  • ***
  • Posts: 141
Re: DataMaker Xml xPath and Json [JANUARY 2016]
« Reply #46 on: February 03, 2016, 10:10:09 AM »
ArrayMaker: 1.1.0.5.f

DataMaker: 1.0.5.0.f

There is also an ArrayMaker folder within the DataMaker folder, but that does not include version info; I'm assuming that compiles as an add-on to the larger ArrayMaker install?

Also, FYI, I just sent you an e-mail re: Case 1387, in response to yours. Seems like there might be some other issues re: iOS deployement.

WilsonC

  • Playmaker Newbie
  • *
  • Posts: 2
Re: DataMaker Xml xPath and Json [JANUARY 2016]
« Reply #47 on: February 14, 2016, 05:21:21 AM »
Hi,

I have the following error message while importing the DataMaker v1.0.6 on Unity 5.3.2 (32bit) with PlayMaker 1.8.0f41 and PUN+ 1.66 on Windows7 SP1 x64

"Assets/Photon Unity Networking/Editor/PhotonNetwork/AccountService.cs(181,45): error CS0433: The imported type `Newtonsoft.Json.JsonConvert' is defined multiple times"

The same error is also repeated while installing DataMaker first and then PUN+. Please take a look with this issue.

Thank you very much!

Regards,

Wilson

dudebxl

  • Hero Member
  • *****
  • Posts: 602
Re: DataMaker Xml xPath and Json [JANUARY 2016]
« Reply #48 on: March 23, 2016, 03:10:11 PM »
Quick question. Is it normal that when you have this in

"Text": {
  "current": [
    I like playmaker,
    I do not like playmaker
  ],
  "type": "txt"
}

The result after xml conversion (from json) and node extraction is this: I like playmakerI do not like playmaker

and not this:  I like playmaker, I do not like playmaker

The comma is missing.. is this normal?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15594
  • Official Playmaker Support
Re: DataMaker Xml xPath and Json [JANUARY 2016]
« Reply #49 on: March 24, 2016, 02:38:59 AM »
Hi,

 your json is not valid, you need to put doublequotes around your entries.

Quote
{
   "Text": {
      "current": [
         "I like playmaker",
         "I do not like playmaker"
      ],
      "type": "txt"
   }
}

Always double check with a online json validator when you have trouble.

Bye,

 Jean

dudebxl

  • Hero Member
  • *****
  • Posts: 602
Re: DataMaker Xml xPath and Json [JANUARY 2016]
« Reply #50 on: March 24, 2016, 08:41:26 AM »
Hi,

Yeah that is very true:)

Actually it is a section of the twitter api Json results. I changed it to make it easier to understand the problem, but yeah it is geoJSON.. anyway i found a way around it in datamaker (you have to run an extra node then eliminate the data from the string by splitting it)

... but it make senses why it would not work. Anyway many thanks for the clarification  :)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15594
  • Official Playmaker Support
Re: DataMaker Xml xPath and Json [JANUARY 2016]
« Reply #51 on: March 25, 2016, 02:15:10 AM »
Hi,

 That's odd that this wrong json formatting comes from twitter. I imagine most browser adjust their formatting rules to comply with messy formats ( like they do for messy html and css...)

Bye,

 Jean

dudebxl

  • Hero Member
  • *****
  • Posts: 602
Re: DataMaker Xml xPath and Json [JANUARY 2016]
« Reply #52 on: March 25, 2016, 11:34:20 AM »
Twitter coordinates:

So others have a reference if they also have this problem - You have to use a geojson extractor.

from twitter api website - It is a section of the json result of GET and it is geoJSON (http://geojson.org/) format and not Json - link (look at coordinates section): https://dev.twitter.com/overview/api/tweets

Twitter api example:
"coordinates":
{
    "coordinates":
    [
        -75.14310264,
        40.05701649
    ],
    "type":"Point"
}

rik

  • Full Member
  • ***
  • Posts: 246
Re: DataMaker Xml xPath and Json [JANUARY 2016]
« Reply #53 on: March 31, 2016, 12:47:15 PM »
HI
i have a problem with json parsing
{"app42":{"response":{"success":true,"timer":{"currentTime":"2016-03-31T15:35:04.685Z"}}}}


above was the json file i am tring to parse but i get error

<app42>
  <response>
    <success>true</success>
    <timer>
      <currentTime>2016-03-31T15:35:04.685Z</currentTime>
    </timer>
  </response>
</app42>

so i try to parse with xml after converting that to xml but for some reason when i use get node properties to get current time i get result like true2016-03-31T15:35:04.685Z

can some one explain how to get it right Thanks

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15594
  • Official Playmaker Support
Re: DataMaker Xml xPath and Json [JANUARY 2016]
« Reply #54 on: April 01, 2016, 02:12:40 AM »
Hi,

 What is the xpath you are using to get to that node? it's likely that access "response" instead of directly "currentTime".

what error do you get when parsing the json?


Bye,

 Jean

rik

  • Full Member
  • ***
  • Posts: 246
Re: DataMaker Xml xPath and Json [JANUARY 2016]
« Reply #55 on: April 01, 2016, 03:30:46 AM »
Hi thanks for quick reply
i did not get any error. but it always send found variable event but it dont store any thing in the variable when i use json


but in xml i did not use xpath i use  get node properties because i was little confused on xml path.

and i dont find any samples for the xpath
« Last Edit: April 01, 2016, 03:32:56 AM by rik »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15594
  • Official Playmaker Support
Re: DataMaker Xml xPath and Json [JANUARY 2016]
« Reply #56 on: April 05, 2016, 02:41:57 AM »
Hi,

you are using "Convert Json to Xml Node" action right? I just tested and it worked, it outputed the json into a dataMaker xmk proxy fine.



then, you use XML Get Node Properties, and in the "property" you put

Code: [Select]
//response/timer/currentTime
and you'll get the content of just that node:



Have a go at this and let me know how it goes.

Bye,

 Jean

rik

  • Full Member
  • ***
  • Posts: 246
Re: DataMaker Xml xPath and Json [JANUARY 2016]
« Reply #57 on: April 05, 2016, 02:21:22 PM »
later i have managed to get the details but why it did not manage to get property details from the json itself ?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15594
  • Official Playmaker Support
Re: DataMaker Xml xPath and Json [JANUARY 2016]
« Reply #58 on: April 05, 2016, 03:14:11 PM »
Hi,

 I did, straight on, maybe you did not provide the json properly? what's your technic to get the string to parse as a json?

Bye,

 Jean

marv

  • Junior Playmaker
  • **
  • Posts: 50
Re: DataMaker Xml xPath and Json [JANUARY 2016]
« Reply #59 on: May 14, 2016, 05:59:32 AM »
Heya, I am getting this error, when trying to use a string variable as a source for datamaker xml actions:

(the same with a GameObject variable with proxy reference)

==================================================

ArgumentException: Object type HutongGames.PlayMaker.FsmString cannot be converted to target type: HutongGames.PlayMaker.FsmEvent
Parameter name: val
System.Reflection.MonoField.SetValue (System.Object obj, System.Object val, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoField.cs:133)
System.Reflection.FieldInfo.SetValue (System.Object obj, System.Object value) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/FieldInfo.cs:150)
HutongGames.PlayMakerEditor.ActionEditor.DoVariableSelection (System.Object userdata) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Editor/Classes/ActionEditor.cs:2779)
UnityEditor.GenericMenu.CatchMenu (System.Object userData, System.String[] options, Int32 selected) (at C:/buildslave/unity/build/artifacts/generated/common/editor/GenericMenuBindings.gen.cs:122)


===================================================

I am using Unity 5.3.4f1 with Playmaker 1.8.0f43. I have created a completely new project and tried an older version of unity, but the problem persists. This has me kind of in a bind since I need a few FSMs on prefab gameobjects to get data from xmls. A fix for this or if anyone can come up with a good workaround for this and let me know would be much, much appreciated.

cheers
« Last Edit: May 14, 2016, 06:05:56 AM by marv »