XML "not well formed" error

Discussion of Photoshop Scripting, Photoshop Actions and Photoshop Automation in General

Moderators: Tom, Kukurykus

undavide

XML "not well formed" error

Post by undavide »

Hello,
I'm having this output from ESTK: "Not well formed - invalid token" when I'm defining an XML as

Code: Select allvar presets = <presets>
  <preset default="true">
    <name>Ternary example</name>
    <formula>Math.abs(255*Math.sin(5*Math.PI*x/255))</formula>
  </preset>
  <preset default="true">
    <name>Ternary example</name>
    <formula>(x<127)?(255-x):(x)</formula>
  </preset>
</presets>;

Apparently, it can't digest the "<" (or the "?" maybe?) in the ternary operator. How do you escape such chars within an XML string?
Thanks!

Davide

Professional AI Audio Generation within Adobe Premiere Pro - Download Free Plugin here

undavide

XML "not well formed" error

Post by undavide »

Escape characters, Watson!
Code: Select allvar presets = <presets>
  <preset default="true">
    <name>Ternary example</name>
    <formula>Math.abs(255*Math.sin(5*Math.PI*x/255))</formula>
  </preset>
  <preset default="true">
    <name>Ternary example</name>
    <formula>(x<127)?(255-x):(x)</formula>
  </preset>
</presets>;

< in this case.
Cheers,
Davide