Adding Fragments and Multiple Nodes

Microsoft XML Diff

Microsoft XML Diff 1.0 and XML Patch 1.0

Adding Fragments and Multiple Nodes

The xd:add element is also used to indicate that a fragment or multiple nodes were added. When fragments or multiple nodes are added, there are no additional attributes on the xd:add element, except an opid attribute that can contain the ID number of the operation when multiple nodes are added. The new fragment is specified as the content of the xd:add element between the <xd:add> and </xd:add> tags. The xd:add element that has no attributes, is also used to indicate the addition of single text nodes, CDATA sections, processing instructions, or comments.

Here is an example of what an xd:add element looks like when a new fragment is found:

<xd:add>
    <Customer>James Brown</Customer>
</xd:add>

The following table describes the attributes of the xd:add element when a fragment is added.

Attribute name Data type Description
opid unsigned int Operation ID

If content is found in an xd:add element when a fragment is added, then the content represents the XML fragment that was added.

For information on an xd:add for single node additions, see XmlDiff Operation xd:add.

See Also

XML Diff Functionality | XML Diff Language (Diffgram) | Path Descriptors | XmlDiff Operation xd:node | XmlDiff Operation xd:add | W3C DOM Node Types | Copying an Existing Node or Fragment | Extended Operations | XmlDiff Operation xd:remove | XmlDiff Operation xd:change | Example of a Diffgram | XmlDiff Class

© 2002 Microsoft Corporation. All rights reserved.