Create an XML sibling

How can I create an XML node sibling to another node? Using the "Create XML Node" action, one can only create a first child or a last child of a referenced parent node. There appears no way in FB to create a sibling node, which is neither first nor last.

For example, lets say we start with: (your forum editor won't let me use XML angle brackets, so using [] instead. Read [ as angle bracket.)

[doc]
  [el x="1"/]
  [el x="3/]

and we want to add node [el x="2"/] as the next sibling of [el x="1"/] like so:

[doc/]
  [el x="1"/]
  [el x="2"/]
  [el x="3"/]
[doc/]

 

We cant do this in FB using the "Create XML Node" action, but maybe there is another way?

Hi Sean

I have added the ability to do this via the Create XML Node action, I will post a new build here shortly.

Regards,
Steve

Hi Sean

I have added the following options to the New Node Details tab of the Create XML Action:
- Insert Before Child At XPath
- Insert After Child At XPath

When you select either of these options you will be able to specify an XPath to the sibling that you would like to reference. For instance you can now insert your node in to the desired by selecting 'Insert After Child At XPath' and providing an XPath as '/doc/el[1]'.

You can download the new build from here:
https://www.finalbuilder.com/downloads/finalbuilder/aex6/FB700_1222.exe

Regards,
Steve

Thanks heaps. This is great support.