Removing DTD instruction from inbound xml document

Home Page Forums BizTalk 2004 – BizTalk 2010 Removing DTD instruction from inbound xml document

Viewing 2 reply threads
  • Author
    Posts
    • #20884

      I have an xml document incoming to BizTalk which is a DTD compliant. It has an instruction in the top of the document like

      <!DOCTYPE SYSTEM …..

      I prepared the schema for corresponding DTD.

      Now, how can I remove this statement from incoming xml document and change it to a schema instruction before passing to orchestration?

      Please help

    • #20912

      Sidhu,

      Take a look at the Microsoft.BizTalk.Streaming namespace (http://technet.microsoft.com/en-us/library/microsoft.biztalk.streaming.aspx), specifically the XmlTranslatorStream (http://technet.microsoft.com/en-us/library/microsoft.biztalk.streaming.xmltranslatorstream.aspx).

      If you extend this class in a decode pipeline component (for example), you can override the TranslateDocType method and strip the DOCTYPE declaration from the incoming message; its a bit fiddly, but it is possible.

      If you want a more low-tech approach, load the Xml Message into a string and remove the DOCTYPE using a find/replace pattern, or stick it through some XSLT that maps back to itself but without the DOCTYPE. Both of these approaches are easily doable, but you will incur a large performance hit with large messages.

      Rgds, Nick.

    • #24226

      Yahoo e-mail spread sheet has misplaced DTD entry.  Please rfemove.  Useless iritation. MICROSOFT link,

Viewing 2 reply threads
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.