How to grab only the first element in Altova Mapforce?
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'
精彩评论