Remove quotes from beginning and end of message to parse XML

John Gasper's icon

Hi all,
I am trying to use the sadam.rapidXML external object to parse an XML file, but when I use zl.slice to remove { "body" : from the beginning of the message, there are still quotes at the beginning and end of the message. I need to remove these to make sadam.rapidXML work.

I want to keep the quotes within the message, as sadam.rapidXML needs them within the message.

I tried fromsymbol and sprintf %s but they removed all the quotes. I am not well versed in java or C, so any help is appreciated!

Thanks!

Robin Parmar's icon

I think this is a problem. Quotation marks and the semicolon are stumbling blocks for Max parsing.

We need a parsing object that ignores characters that otherwise have meta meaning.

Luke Woodbury's icon

I am no regular expression expert by any means, but I think I did something similar with [jit.str.regexp], have a look at the 'downloading and parsing' tab of the help file. Happy to have a look if you can post an example.

Mark's icon

maybe you can do it using [regexp].
i don't have time to try it out at the moment.
but perhaps this post may be of some help:
https://cycling74.com/forums/filtering-out-characters-from-strings-or-lists