Create/modify CDATA section in XML files...?

Post Reply
BuckXUK
Newbie
Posts: 18
Joined: Thu Mar 01, 2012 8:43 pm

Create/modify CDATA section in XML files...?

Post by BuckXUK » Fri May 11, 2018 7:31 pm

Hello everyone

I'm checking in to see if anyone has come up with a way to modify or replace a CDATA section using the scripting API in Switch?

I'm able to retrieve the CDATA contents and modify the string data using string.replace, but I don't see any way to create and/or replace the CDATA elements in XML.

If there was only one iteration of a CDATA section, I'd happily SED it into position but there will be literally thousands per file.

Does anybody have any ideas?

Thanks in advance.
Regards,

William Buckingham

r.zegwaard
Member
Posts: 24
Joined: Fri Jul 08, 2011 10:31 am

Re: Create/modify CDATA section in XML files...?

Post by r.zegwaard » Mon May 14, 2018 7:16 am

Currently the scripting API doesn't support CDATA :cry: . The workaround would be to create/edit the xml and add the CDATA tags manually as "<![CDATA[content]]>" . After that, load the file as normal text-file, and do a search/replace.

A feature-request (ENFFR-1968) has been made to support CDATA.

BuckXUK
Newbie
Posts: 18
Joined: Thu Mar 01, 2012 8:43 pm

Re: Create/modify CDATA section in XML files...?

Post by BuckXUK » Mon May 14, 2018 6:28 pm

Thanks for the reply and suggestions.

I'm exploring other options with the customer how to best handle this...hopefully we'll get that feature sometime in the not-to-distant future.

Thanks again.
Regards,

William Buckingham

Post Reply