# Adding elements/results to document

**URL:** <https://techcommunity.softwareag.com/t/adding-elements-results-to-document/58627>\
**Category:** Forum\
**Tags:** Former-Crossvision-Products, Service-Orchestrator\
**Created:** [September 7, 2004, 6:18pm UTC](https://techcommunity.softwareag.com/t/adding-elements-results-to-document/58627 "2004-09-07T18:18:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jean\_Bodemer](https://avatars.discourse-cdn.com/v4/letter/j/c67d28/32.png) [@Jean\_Bodemer](https://techcommunity.softwareag.com/u/Jean_Bodemer)\
**Post date:** [September 7, 2004, 6:18pm UTC](https://techcommunity.softwareag.com/t/adding-elements-results-to-document/58627/1 "2004-09-07T18:18:06Z")

</div>

Hi,  
  
I would like to know the best method to add new elements and results to a xml document in Mediator.  
  
I have two situations. In one I have a request xml document from which I create a soap call. I then want to add the result to the original document but in a new element that does not exist. In the other I want to add xml from a fixed xml document (using payloadsetter).  
  
An example, here is the input document.  
  
  
 RequestClient  
  
  
 121  
  
  
  
I would like to add the result of the soap call below payload enclosed in an element “soap result here”.  
  
So far the only solution I can think of is to put the result of the call in a new message and then do a transformation. But is that effective, is there a performance penalty? Isn’t there an easier way, like adding the result tags arround the xpath statement for the result?  
  
For the second situation where I use the payloadSetter, I have two options. Either a transformation or a replicate statement with a cut and paste. Which is better?  
  
I’m mainly concerned of performance when my documents start getting bigger and volumes increase.  
  
Regards,  
Jean

---

<div class="post-metadata">

**Author:** ![Mike\_Bernat](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Mike\_Bernat](https://techcommunity.softwareag.com/u/Mike_Bernat)\
**Post date:** [September 8, 2004, 8:05pm UTC](https://techcommunity.softwareag.com/t/adding-elements-results-to-document/58627/2 "2004-09-08T20:05:34Z")

</div>

Hi Jean,  
  
Starting with 7.3.1.1 (just released) a new attribute “createTarget=” is allowed on the statement. It functions the same as the existing “target=” attribute except that it will create any elements that are not present in the document. So in your example you could specify:  
  
  
Hope this helps.  
  
Best regards,  
 Mike

---

<div class="post-metadata">

**Author:** ![Jean\_Bodemer](https://avatars.discourse-cdn.com/v4/letter/j/c67d28/32.png) [@Jean\_Bodemer](https://techcommunity.softwareag.com/u/Jean_Bodemer)\
**Post date:** [September 15, 2004, 3:57pm UTC](https://techcommunity.softwareag.com/t/adding-elements-results-to-document/58627/3 "2004-09-15T15:57:05Z")

</div>

Thanks Mike, just one more question although I think I already know it can’t be done.  
  
Is it possible to use properties to temporarily store xml not just the values? Let’s say I want to use a part of the document in a different sequence but want to pass it as a property.   
  
Jean

---

<div class="post-metadata">

**Author:** ![Mike\_Bernat](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Mike\_Bernat](https://techcommunity.softwareag.com/u/Mike_Bernat)\
**Post date:** [September 16, 2004, 7:12pm UTC](https://techcommunity.softwareag.com/t/adding-elements-results-to-document/58627/4 "2004-09-16T19:12:09Z")

</div>

Hi Jean,  
  
Currently property values are only strings. You can, however, use other message parts to contain temporary XML documents and fragments.  
  
Best regards,  
 Mike

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 2:39pm UTC](https://techcommunity.softwareag.com/t/adding-elements-results-to-document/58627/5 "2021-04-02T14:39:22Z")

</div>

Closed on April 2, 2021, 2:39pm UTC


