I’m trying to export a javascript design element to a file in a Java agent. The problem is that if I set the ForceNoteFormat of the DXL exporter to false, I get a DXL output where I can find the javascript code inside the ‘javascript’ tag. I can’t really use this because it is UTF-8 encoded, and it will break the script if invalid characters are found, like ‘>’ inside a string manipulation.
So my second try was to set ForceNoteFormat to true, the code is then accessable inside the ‘rawitemdata’ tag, so I decoded the Base64 string and above problem was solved, except it also includes some header information I think.
I found almost the same problem here, but it is about extracting images from base64 decoded DXL : http://lekkimworld.com/2006/03/17/helping_out_a_fellow_blogger_getting_the_actual_bytes_of_an_image_resource_a_lesson_in_the_intricacies_of_dxl_representation.html
Can anyone point me in the right direction how I can get the pure untouched script out of the exported DXL?
You need to take a different approach. Use the IResource API in Domino Designer. This gives you nice access to the Js without anything sprinkled in. The import/export plugin on OpenNTF does that so look at the source.