I'm looking to merge two nodes (or more) into one. I've worked with xslt for a little while, but mainly doing pretty simple stuff. I've done much searching, but solutions have been over my head so I haven't been able to adapt to my own problem. Closest thing I've found is an answer by Martin Honnen using a function he built called "eliminate-deep-equal-duplicates".
My problem is I can have two or more <Coverage> nodes that have "CoverageCd=ADDRL" and I need to combine these nodes only, no other Coverage nodes with other CoverageCd values. So I want to merge the ADDRL nodes but keep the unique "Addr" child node for all ADDRL iterations.
One other caveat is that I need to have the count of merged ADDRL nodes and place in the "OptionValue" element. So In my example where I have two ADDRL Coverage nodes my OptionValue needs to be 2. My xslt currently almost gives me what I need, but duplicates the MiscParty/GeneralPartyInfo which I don't want. And while I have the variable AddrlCount that gives me the correct value to place in my OptionValue,
I'm not quite sure how to incorporate that into the current xslt. I know my main problem is that I'm not exactly sure what the "eliminate-deep-equal-duplicates" function is doing. Any help anyone could provide would be greatly appreciated.