开发者

How to grab only the first element in Altova Mapforce?

开发者 https://www.devze.com 2023-04-01 03:02 出处:网络
I am trying to 开发者_C百科grab only the first instance of an element from an xml document in Mapforce but I can\'t find a function in the default set libraries that does this. Does anyone know how to

I am trying to 开发者_C百科grab only the first instance of an element from an xml document in Mapforce but I can't find a function in the default set libraries that does this. Does anyone know how to create a custom User-Defined function that can do this or any other way to accomplish this?

There is also a chance that these elements might occur in separate locations. E.g. There is 3 Person elements ({Person id="1"} {Person id="2"} {Person id="3"}) and all might have a single FirstName element, but I just want the {Person id="1"}'s FirstName element. So the row position of each FirstName element is 1, even though there are three of them that occur throughout the document.

Also does anyone know of any websites with some good information on the syntax used in a custom User-Defined function?


The position library function, found under node functions should do the trick. Plug the node you're checking into its output, then plug the result into an equals function into the a input. For the b input, insert a constant equal to the increment you want to check for.

Note that when generating C# code, the position function will trigger an error if no input nodes are actually present in your XML source doc. Seems like you'

0

精彩评论

暂无评论...
验证码 换一张
取 消