Dynamic XML node insertion

Hi All,

I would like to add a node dynamically within a XML document, based on the type of document. The X-Path for each document is stored in the database, which is accessed at run time. Based on the X-Path, I would like to add a node for each document. I know that this is possible using Dynamic XSL. Has somebody used this within webMethods?

Is there any other alternative way to do this?

It can be done within webMethods using the Branch Sequence documentToRecord functions, but this would mean I will have to have a sequence per document type, which of course I would like to avoid.

Any suggestions are most welcome.

  • Rajesh Rao

Can you explain it with an example ?

Hi Rupinder,

I have document 1

<order>
<orderheader>

</orderheader>
<order>

I have document 2

<invoice>
<invoiceheader>

</invoiceheader>
<invoice>

I need to add a node
<buyerparty>
<name>Name1</name>
</buyerparty>
in the header section of both the documents.

I have the path
Order --> /Order/OrderHeader/
Invoice --> /Invoice/InvoiceHeader/

stored in the table

I need to access the table and add the node BuyerParty based on the X-path fetched.

  • Rajesh Rao