xml - LinkedIn API Doesn't Support All Characters? -


i want create share linkedin api, won't allow me use < or > obvious reasons. since use xml it's quite tricky. i've tried url encoding, backslash insertion, , html character replacement < > gt; , lt;

var body = "\     <share>\       <comment>" + message + " </comment>\       <visibility><code>anyone</code></visibility>\     </share>\   "; 

how can include < or > without having linkedin server freak out when sees "unexpected character"?

trying construct xml concatenating strings going error-prone. you've not said in question programming language you're using, modern language should have libraries build xml , handle necessary escaping you.

alternatively this document suggests linkedin apis can work json xml, may easier approach particularly if you're working in language javascript.


Comments