|
January 26, 2002 Copying DOMDocuments Tips: January 2002
Yehuda Shiran, Ph.D.
|
|
You can copy the content of one DOMDocument object to another with the save() method. Call the source DOMDocument's save method with the other object as a parameter. The following function defines two DOMDocument objects, xmldoc and xmldoc2. We first read the external mydvd.xml file into xmldoc, and then copy its content to the xmldoc2 object:
Let's call this script now. The alert box shows the content of xmldoc2.
People who read this tip also read these tips: Look for similar tips by subject: |