playMaker

Author Topic: Data Maker XML select nodes Bug?[SOLVED]  (Read 81 times)

ubernurbs

  • Playmaker Newbie
  • *
  • Posts: 11
    • View Profile
Data Maker XML select nodes Bug?[SOLVED]
« on: November 14, 2018, 04:29:34 AM »
This XML works:
Code: [Select]
<?xml version="1.0" encoding="utf-8"?><textures>
<image id='1' file='NaturelYoghBeker.jpg' url='http://3d-server.xx/packageview/test/artwork/450mlcup/artwork1/4unity/NaturelYoghBeker.jpg'></image>
<image id='2' file='test.jpg' url='http://3d-server.xx/packageview/test/artwork/450mlcup/artwork1/4unity/test.jpg'></image>
</textures>

I get an error event on this xml:
Code: [Select]
<?xml version="1.0" encoding="utf-8"?><textures>
<image id='1' file='NaturelYoghBeker.jpg' url='http://3d-server.xx/packageview/imgd.php?src=packageview/test/artwork/450mlcup/artwork1/NaturelYoghBeker.jpg&width=4096&height=4096&nu'></image>
<image id='2' file='test.jpg' url='http://3d-server.xx/packageview/imgd.php?src=packageview/test/artwork/450mlcup/artwork1/test.jpg&width=4096&height=4096&nu'></image>
</textures>

Log warning:
Code: [Select]
'=' is an unexpected token. The expected token is ';'. Line 2, position 162.
UnityEngine.Debug:LogWarning(Object)
FsmXmlSource:GetXmlNodeFromString(String) (at Assets/PlayMaker DataMaker/Xml/Actions/__internal__/FsmXmlSource.cs:42)
FsmXmlSource:get_Value() (at Assets/PlayMaker DataMaker/Xml/Actions/__internal__/FsmXmlSource.cs:56)
HutongGames.PlayMaker.Actions.XmlSelectNodes:SelectNodeList() (at Assets/PlayMaker DataMaker/Xml/Actions/XML Read/XmlSelectNodes.cs:77)
HutongGames.PlayMaker.Actions.XmlSelectNodes:OnEnter() (at Assets/PlayMaker DataMaker/Xml/Actions/XML Read/XmlSelectNodes.cs:66)
HutongGames.PlayMaker.FsmState:ActivateActions(Int32) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:205)
HutongGames.PlayMaker.FsmState:OnEnter() (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:175)
HutongGames.PlayMaker.Fsm:EnterState(FsmState) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2767)
HutongGames.PlayMaker.Fsm:SwitchState(FsmState) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2714)
HutongGames.PlayMaker.Fsm:UpdateStateChanges() (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2642)
HutongGames.PlayMaker.Fsm:DoTransition(FsmTransition, Boolean) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2681)
HutongGames.PlayMaker.Fsm:ProcessEvent(FsmEvent, FsmEventData) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2252)
HutongGames.PlayMaker.Fsm:BroadcastEventToGameObject(GameObject, FsmEvent, FsmEventData, Boolean, Boolean) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2564)
HutongGames.PlayMaker.Fsm:Event(FsmEventTarget, FsmEvent) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2381)
HutongGames.PlayMaker.DelayedEvent:Update() (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/DelayedEvent.cs:93)
HutongGames.PlayMaker.Fsm:UpdateDelayedEvents() (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2043)
HutongGames.PlayMaker.Fsm:Update() (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:1988)
PlayMakerFSM:Update() (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/PlayMakerFSM.cs:579)

One of the equal signs cause this error?

Cheers

Hans
« Last Edit: November 14, 2018, 10:38:40 PM by jeanfabre »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 3664
    • View Profile
    • jinxtergames
Re: Data Maker XML select nodes Bug?
« Reply #1 on: November 14, 2018, 07:58:19 AM »
Hi.
Yes, there is an error somewhere in you 2nd xml. (with the width and height)

you can use https://www.xmlvalidation.com/

to test if an xml is valid.
it will also show the error.

ubernurbs

  • Playmaker Newbie
  • *
  • Posts: 11
    • View Profile
Re: Data Maker XML select nodes Bug?
« Reply #2 on: November 14, 2018, 04:47:07 PM »
That helped a lot.

The XML was not valid as it contained offending characters that could be wrongfully interpreted as markup.

The XML was generated with php, so it that was pretty easy to solve.

replace ' with &apos;
replace " with &quot;
replace & with &amp;
replace < with &lt;
replace > with &gt;

And Data Maker works Flawless again!

Edit:

The & was the only offending character, so a simple string replace before processing the XML, and replace it back afterwards was even more convenient, as it could be done in playmaker, no need to edit the xml generator in php.

Thanks!

Hans
« Last Edit: November 16, 2018, 09:46:10 AM by ubernurbs »