@chrisbiscardi Chris, you pointed me in the right direction. My logic is technically correct, but since I'm reverse engineering another applications database I didn't realize internally it tracked the tag /bar as both the root tag and the child tag /bar. Looks like I'll have to rethink my logic so that I can properly turn /bar into [[foo]][[bar]] (or [[foo]] ).

Appreciate the virtual rubber ducking