by eliasen
25. April 2009 21:02
Hi all
So, first I had a post about promoting reoccurring elements where I discussed 4 options for promoting an element that can occur multiple times in the input. Then I had a post about how you can pseudo do it in BizTalk 2000/2002.
This post is about two things:
- Another way of doing it that doesn’t work
- Writing the custom pipeline component that was my second suggestion in my first post.
First issue
As discussed in my first post, if you change the XPath of the promoted property in the schema (either by clicking the ellipsis as I wrote about or manually editing the XSD) to add the “[1]”, you get this compilation error:
Node "ElementWhereNumber1IsPromoted" - The promoted property field or one of its parents has Max Occurs greater than 1. Only nodes that are guaranteed to be unique can be promoted as property fields.
But, since I couldn’t get the “[1]” to work in BizTalk 2000/2002 when editing my second post I used the position function instead. So i started wondering if that might work in BizTalk 2006 R2. It doesn’t, though. It compiles just fine, and I really had my hopes up, but at runtime you get this error:
There was a failure executing the receive pipeline: "Microsoft.BizTalk.DefaultPipelines.XMLReceive, Microsoft.BizTalk.DefaultPipelines, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Source: "XML disassembler" Receive Port: "ReceivePort3" URI: "C:\Projects\Blog Entries\PrommotingReoccurringElementsEditXSD\Instances\In\*.xml" Reason: Unexpected XPath format:
So i had to drop that idea again.
Second issue
I decided to write the custom pipeline component that I discussed in my first post.
The main code is easy – just three properties:
- Name of the property
- Namespace of the property
- XPath
You can download it at http://eebiztalkpipelinecom.codeplex.com/ where I have just made my initial release.
--
eliasen
5b0145de-2334-4cc4-b4eb-f085a15e81e4|0|.0
Tags: