XML Declaration
-
Tuesday, January 24, 2012 10:06 AM
Hi,
I have a question regarding the standard XML Assembler.
I have this in my outgoing XML : <?xml version='1.0' encoding='UTF-8'>
But I need to strip off the XML declaration, so I changed the setting in my PipelineComponent (Add XML Declaration) to false. And as requested it strips off that <?xml version='1.0' encoding='UTF-8'>.The question now is if there is a possibility to keep the XML Declaration but only strip off the enconding part of the XML Declaration? So I have something like this <?xml version='1.0' >.
Regards,
Glenn
Glenn Colpaert - MCTS BizTalk Server - Blog : http://blog.codit.eu
All Replies
-
Tuesday, January 24, 2012 10:19 AM
You could make a custom pipeline component and implement it on the send pipeline after the assembler stage and have it replace the encoding with nothing using regular expressions:
Search: (?<=\<\?xml version="1.0" )encoding="UTF-8"( )?(?=\?\>)
Replace: (Empty String)
Note: It should only replace UTF-8 instances since UTF-8 is the default encoding and all other encodings should be specified
Morten la Cour- Proposed As Answer by Shay Feldman Tuesday, January 24, 2012 10:25 AM
- Marked As Answer by GlennColpaert Thursday, January 26, 2012 7:38 AM
-
Tuesday, January 24, 2012 4:48 PMModerator
It can be done easily with Symbol preprocessor pipeline component (See MSDN)
make sure your RegEx (or several simple replaced string) covers all possible variations of the declaration.
Leonid Ganeline [BizTalk MVP] BizTalk and 0MQ (ZeroMQ)
- Edited by Leonid GanelineMVP, Moderator Tuesday, January 24, 2012 4:49 PM
- Proposed As Answer by Steef-Jan WiggersMVP, Moderator Wednesday, January 25, 2012 12:19 AM
- Marked As Answer by GlennColpaert Thursday, January 26, 2012 7:38 AM
-
Thursday, January 26, 2012 7:38 AM
Thx for clearing this out.
If there is no standard way of getting only the prolog, a custom pipelinecomponent will do...
Glenn Colpaert - MCTS BizTalk Server - Blog : http://blog.codit.eu

