EldoS | Feel safer!

Software components for data protection, secure storage and transfer

insert an XML document within an XML node from another document

Also by EldoS: MsgConnect
Cross-platform protocol-independent communication framework for building peer-to-peer and client-server applications and middleware components.
#36845
Posted: 05/31/2016 10:09:11
by Victor Villegas (Standard support level)
Joined: 02/27/2012
Posts: 18

Hello,
I need to insert an XML document within a node from another XML document.

I have an XML document like the following:

Code
<DTE version="1.0">
      <Document>
             <IdDoc>
                   ...
                   ...
             </IdDoc>
      </Document>
</DTE>


And I need to insert within a node from another document, that looks like this:

Code
<EnvDTE>
     <SetDTE ID="SetDoc">
           <Caratula>
                 ...
                 ...
           </Caratula>
           <DTE version="1.0">
                 <Document>
                        <IdDoc>
                              ...
                              ...
                        </IdDoc>
                 </Document>
           </DTE>
      </SetDTE>
</EnvDTE>


Thanks
#36848
Posted: 05/31/2016 13:19:30
by Dmytro Bogatskyy (EldoS Corp.)

Thank you for contacting us,

Quote
I need to insert an XML document within a node from another XML document.

To do this you need to use XML DOM methods, such as CloneNode(), AppendChild(). For details please refer to https://www.eldos.com/documentation/sb...mnode.html
For example:
Code
ParentDestNode.AppendChild(SrcDocument.DocumentElement.CloneNode(true, DestDocument));
#36849
Posted: 05/31/2016 15:16:59
by Victor Villegas (Standard support level)
Joined: 02/27/2012
Posts: 18

Thanks DMytro but I don't understand,

what is ParentDestNode and SrcDocument?

You have a more detailed example of how to do?
#36852
Posted: 05/31/2016 16:01:42
by Dmytro Bogatskyy (EldoS Corp.)

Hi,

Quote
what is ParentDestNode and SrcDocument?

I have assumed, that you will load your XML documents using TElXMLDOMDocument class. So, SrcDocument and DestDocument are TElXMLDOMDocument objects, and ParentDestNode is a parent element where you want to copy your source xml document, it has type TElXMLDOMElement.
#36853
Posted: 05/31/2016 17:23:00
by Victor Villegas (Standard support level)
Joined: 02/27/2012
Posts: 18

everything ok
thank you very much
Also by EldoS: BizCrypto
Components for BizTalk® and SQL Server® Integration Services that let you securely store and transfer information in your business automation solutions.

Reply

Statistics

Topic viewed 1020 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!