Situation:
When a XML file doesn't contain the definition of XML Version and Encoding, then to utilize that XML document in the Process Designer by another activity(Mapping/Plugin) a Custom Plugin can be used that will append XML version and Encoding to generate a valid XML. This plugin can also be utilized for appending anything before any valid XML file as per client requirement.
Solution:-
We have to place Custom Plugin that can be used to include XML version and encoding declaration line if it is not present. Steps to Add Custom Plugin are:-
- Create a Custom Plugin activity using attached Script:- Services > Extensions > Custom Plugin
- Set Character Set Encoding of Custom Plugin as ISO-8859-1.
- Place the Custom Plugin activity just after activity which do not define XML Version and Encoding.
Example:-
A process flow with Data Splitter Custom Plugin is not Working because the XML document generated from Custom plugin(Append_CP) is Input to the Data Splitter Custom Plugin and it generates a invalid XML file as it doesn't have XML version and encoding specified in the XML document. We can then create and use the attached Custom Plugin to create a Valid XML file.
Note:-
Please make sure that the streaming is correct and Custom plugins are getting correct and desired input.
The attached Plugin script can be modified to append anything before any XML file.
Comments
0 comments
Article is closed for comments.