Promote an XML Element

Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Promote an XML Element

Viewing 1 reply thread
  • Author
    Posts
    • #22304

      Hi all,

      My XML message has an element named UNIT. There can be multiple records in this XML. But in each record the value of UNIT is going to remain same,

      I need to promote these element UNIT so that I can access it in the orchestration. Currently, I cannot promote it because BizTalk do not allow to promote elements which can occur multiple times.

      Please let me know how can I accomplish these task

      Thanks and regards,

      Kunal

    • #22306

      The proper way to do this is to use the xpath function inside your orchestration
      http://msdn.microsoft.com/en-us/library/ms963270.aspx
      You can use an indexed xpath statement to extract the first value of UNIT and assign this to a variable or  a message property.
      e.g. stringVariable = xpath(inputmessage, “//UNIT[0]”);

      An alternative if you need to promote the value of UNIT to use for routing the message. Schema files contain some BizTalk specific annotations that specify what data elements that are promoted by the XmlDisassembler. These use xpath statements associated with a particular property defintions.
      The schema editor will not allow you promote a element that can occur more than once. But the runtime does not check. You can manually edit the schema file to use an indexed xpath statement to specify the value you wish to promote. The down side of doing this, is you must always edit the schema file with notepad if you ecer open the file with the Biztalk schema editor.

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