view Side-By-Side changes
SIMPLE WG J. Urpalainen Internet-Draft NokiaResearch CenterIntended status: Standards Track August 9, 2007 Expires:September 7, 2006 March 6, 2006February 10, 2008 An Extensible Markup Language (XML) Patch Operations Framework Utilizing XML Path Language (XPath) Selectorsdraft-ietf-simple-xml-patch-ops-02draft-ietf-simple-xml-patch-ops-03 Status of this Memo By submitting this Internet-Draft, each author represents that any applicable patent or other IPR claims of which he or she is aware have been or will be disclosed, and any of which he or she becomes aware will be disclosed, in accordance with Section 6 of BCP 79. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet- Drafts. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." The list of current Internet-Drafts can be accessed at http://www.ietf.org/ietf/1id-abstracts.txt. The list of Internet-Draft Shadow Directories can be accessed at http://www.ietf.org/shadow.html. This Internet-Draft will expire onSeptember 7, 2006.February 10, 2008. Copyright Notice Copyright (C) TheInternet Society (2006).IETF Trust (2007). Abstract Extensible Markup Language (XML) documents are widely used as containers for the exchange and storage of arbitrary data in today's systems.UpdatesIn order tothis data require transportingsend changes to an XML document, an entire copy of theentire XML document between hosts,new version must be sent, unlessthere'sthere is amechanism that allows exchangingmeans of indicating only theupdates of XML documents.portions that have changed. This document describes an XML patch framework utilizing XML Path language (XPath) selectors. These selector values and updated new data content Urpalainen Expires February 10, 2008 [Page 1] Internet-Draft Patch Operations August 2007 constitute the basis of patch operations described in this document.Urpalainen Expires September 7, 2006 [Page 1] Internet-Draft Patch Operations March 2006In addition to them, with basic <add>, <replace> and <remove> directives a set of patches can then be applied to update an existing XML document. Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . .34 2. Conventions . . . . . . . . . . . . . . . . . . . . . . . . .34 3. Basic Features and Requirements . . . . . . . . . . . . . . .45 4. Patch Operations . . . . . . . . . . . . . . . . . . . . . . . 6 4.1. Locating the Targetforof a Patch . . . . . . . . . . . . .6. 7 4.2. Namespace Mangling . . . . . . . . . . . . . . . . . . . .67 4.3. <add> Element . . . . . . . . . . . . . . . . . . . . . .8 4.4. <replace>9 4.3.1. Adding an Element . . . . . . . . . . . . . . . . . . 10 4.3.2. Adding an Attribute . . . . . . . . . . . . . . . . . 10 4.3.3. Adding a Prefixed Namespace Declaration . . . . . . . 114.5. <remove> Element4.3.4. Adding Node(s) with the 'pos' Attribute . . . . . . . 11 4.3.5. Adding Multiple Nodes . . . . . . . . . . . . . . . . 11 4.4. <replace> Element . . . . . . . . . . . . . . . . . . . . 125. Error Handling4.4.1. Replacing an Element . . . . . . . . . . . . . . . . . 12 4.4.2. Replacing an Attribute Value . . . . . . . .14 6. Usage of Patch Operations. . . . . 13 4.4.3. Replacing a Namespace Declaration URI . . . . . . . . 13 4.4.4. Replacing a Comment Node . . . . .14 7. Usage of Selector Values. . . . . . . . . . 13 4.4.5. Replacing a Processing Instruction Node . . . . . . . 13 4.4.6. Replacing a Text Node . . .14 8. Full Example. . . . . . . . . . . . . 13 4.5. <remove> Element . . . . . . . . . . . . . . . . . . . . . 149. XML Schema4.5.1. Removing an Element . . . . . . . . . . . . . . . . . 14 4.5.2. Removing an Attribute . . . . . . . . .16 10. IANA Considerations. . . . . . . 14 4.5.3. Removing a Prefixed Namespace Declaration . . . . . . 15 4.5.4. Removing a Comment Node . . . . . . . .18 10.1. XML Schema Registration. . . . . . . 15 4.5.5. Removing a Processing Instruction Node . . . . . . . . 15 4.5.6. Removing a Text Node . .18 11. Security Considerations. . . . . . . . . . . . . . . 15 5. Error Handling . . . .18 12. Acknowledgments. . . . . . . . . . . . . . . . . . . . 15 6. Usage of Patch Operations . . .19 13. References. . . . . . . . . . . . . . . 16 7. Usage of Selector Values . . . . . . . . . . .19 13.1. Normative References. . . . . . . . 16 8. XML Schema . . . . . . . . . . .19 13.2. Informative References. . . . . . . . . . . . . . . 16 9. IANA Considerations . . .20 Author's Address. . . . . . . . . . . . . . . . . . 18 9.1. XML Schema Registration . . . . . . .21 Intellectual Property and Copyright Statements. . . . . . . . . .22 Urpalainen Expires September 7, 2006 [Page 2] Internet-Draft Patch Operations March 2006 1. Introduction18 10. Security Considerations . . . . . . . . . . . . . . . . . . . 19 11. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 19 12. References . . . . . . . . . . . . . . . . . . . . . . . . . . 19 12.1. Normative References . . . . . . . . . . . . . . . . . . . 19 12.2. Informative References . . . . . . . . . . . . . . . . . . 20 Appendix A. Informative Examples . . . . . . . . . . . . . . . . 20 A.1. Adding an Element . . . . . . . . . . . . . . . . . . . . 20 A.2. Adding an Attribute . . . . . . . . . . . . . . . . . . . 21 Urpalainen Expires February 10, 2008 [Page 2] Internet-Draft Patch Operations August 2007 A.3. Adding a Prefixed Namespace Declaration . . . . . . . . . 21 A.4. Adding a Comment Node with the 'pos' Attribute . . . . . . 22 A.5. Adding Multiple Nodes . . . . . . . . . . . . . . . . . . 22 A.6. Replacing an Element . . . . . . . . . . . . . . . . . . . 23 A.7. Replacing an Attribute Value . . . . . . . . . . . . . . . 24 A.8. Replacing a Namespace Declaration URI . . . . . . . . . . 24 A.9. Replacing a Comment Node . . . . . . . . . . . . . . . . . 25 A.10. Replacing a Processing Instruction Node . . . . . . . . . 25 A.11. Replacing a Text Node . . . . . . . . . . . . . . . . . . 26 A.12. Removing an Element . . . . . . . . . . . . . . . . . . . 26 A.13. Removing an Attribute . . . . . . . . . . . . . . . . . . 27 A.14. Removing a Prefixed Namespace Declaration . . . . . . . . 28 A.15. Removing a Comment Node . . . . . . . . . . . . . . . . . 28 A.16. Removing a Processing Instruction Node . . . . . . . . . . 29 A.17. Removing a Text Node . . . . . . . . . . . . . . . . . . . 29 A.18. Several Patches With Namespace Mangling . . . . . . . . . 30 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 32 Intellectual Property and Copyright Statements . . . . . . . . . . 33 Urpalainen Expires February 10, 2008 [Page 3] Internet-Draft Patch Operations August 2007 1. Introduction Extensible Markup Language (XML) [2] documents arewidely used as containers forwidely used as containers for the exchange and storage of arbitrary data in today's systems. In order to send changes to an XML document, an entire copy of the new version must be sent, unless there is a means of indicating only the portions that have changed (patches). This document describes an XML patch framework which utilizes XML Path language (XPath) [3] selectors. An XPath selector is used to pinpoint the specific portion of the XML that is the target for the change. These selector values and updated new data content constitute the basis of patch operations described in this document. In addition to them, with basic <add>, <replace> and <remove> directives a set of patches can be applied to update an existing initial XML document. With these patch operations, a simple semantics for data oriented XML documents [7] is achieved, that is, modifications like additions, removals or substitutions of elements and attributes can easily be performed. This document does not describe a full XML diff format, only basic patch operation elements which can be embedded within a full format which typically has additional semantics. As a one concrete example, in the Session Initiation Protocol (SIP) [16] based presence system a partial PIDF XML document format [14] consists of the existing PIDF document format combined with the patch operations elements described in this document. In general, patch operations can be used in any application that exchanges XML documents, for example within the SIP Events framework [13]. Yet another example is XCAP-diff [15] which uses this framework for sending partial updates of changes to XCAP [12] resources. 2. Conventions In this document, the key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" are to be interpreted as described in RFC 2119, BCP 14 [1] and indicate requirement levels for compliant implementations. The following terms are used in this document: Initial XML document: An initial XML document that is going to be updated with a set of patches. Urpalainen Expires February 10, 2008 [Page 4] Internet-Draft Patch Operations August 2007 XML diff document: An XML document that contains patch operation elements, namespace declarations and all the document content changes that are needed in order to transform an initial XML document into a new patched XML document. Patched XML document: An XML document that results after applying one or more patch operations defined in the XML diff document to the initial XML document. Patch operation: A single change, i.e. a patch that is being applied to update an initial XML document. Patch operation element: An XML element that represents a single patch operation. Type definition for an element: A W3C Schema type definition for an element that describes a patch operation content. In-scope namespace declaration: A list of all in-scope namespace declarations within a context node. The QName expansion of a context node is based on mapping a prefix with one of these declarations. For an element, one namespace binding may have an empty prefix. Positional constraint: A number enclosed with square brackets. It can be used as a location step predicate. Located target node: A node which was found from the initial XML document with the aid of an XPath selector value. White space text node: A text node which contains only white space. 3. Basic Features and Requirements In this framework, XPath selector values and new data content are embedded within XML elements, theexchangenames of which specify the modification to be performed: <add>, <replace> or <remove>. These elements (patch operations) are defined by schema types with the W3C Schema language [5]. XPath selectors pinpoint the target for a change andstoragethey are expressed as attributes ofarbitrarythese elements. The child node(s) of patch operation elements contain the new data content. In general when applicable, the new content SHOULD be moved unaltered to the patched XML document. XML documents which are equivalent for the purposes of many applications MAY differ intoday's systems. An exampletheir physical representation. The aim ofsuch a systemthis document is to describe a deterministic framework where theCommon Presence Profile (CPP) [16] compatible presence system,Urpalainen Expires February 10, 2008 [Page 5] Internet-Draft Patch Operations August 2007 canonical form with comments [6] of an XML document determines logical equivalence. For example, white space text nodes MUST be processed properly inwhich presence dataorder to fulfil this requirement as white space isrepresented usingby default significant [6]. The specifications referencing these element schema types MUST define the full XMLbased Presence Information Data Format (PIDF) [17]. Updates todiff format with an appropriate MIME type [11] and a character set, e.g. UTF-8 [9]. For example, the partial PIDF format [14] includes thisdata require transporting ofschema and describes additional definitions to produce a complete XML diff format for partial presence information updates. As theentire XMLschema defined in this documentbetween hosts, unless there's a mechanism that allows exchanging onlydoes not declare any target namespace, theupdatestype definitions inherit the target namespace ofan XML document. This document describes an XML patch framework which utilizesthe including schema. Therefore, additional namespace declarations within the XMLPath language (XPath) [3] selectors. An XPath selectordiff documents can be avoided. It isused to pinpoint the target for a change. These selector valuesanticipated that applications using these types will define <add>, <replace> andupdated new data content constitute<remove> elements based on thebasis of patch operations describedcorresponding type definitions in thisdocument.schema. Inaddition to them, with basic <add>, <replace> and <remove> directivesaddition, an application may reference only asetsubset ofpatches can be applied to update an existing initial XML document. Withthesepatchtype definitions. A future extension can introduce other operations,a simple semantics for datae.g. with document orientedXML documentsmodels [7]is achieved, that is, modifications like additions, removals or substitutions of elements and attributes can easily be performed. This document does not describeafull XML diff format, only basic patch<move> operationelements which can be embedded within a full format. As an example, in the Session Initiation Protocol (SIP) [18] based presence systemand apartial PIDF XML document format [13] consists of the existing PIDF document formattext node patching algorithm combined withthe patch operations<move> would undoubtedly produce smaller XML diff documents. The instance document elementsdescribed in this document. In general, patch operationsbased on these schema type definitions MUST be well formed and SHOULD be valid. The following XPath 1.0 data model node types can beused in any application that exchangesadded, replaced or removed with this framework: elements, attributes, namespaces, comments, texts and processing instructions. The full XMLdocuments, for example withinprolog including e.g. XML entities [2] and theSIP Events framework [12]. Another example is XCAP-diff [14] which uses this framework for sending partial updatesroot node ofchangesan XML document cannot be patched according toXCAP [15] resources. 2. Conventions Inthisdocument, the key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY",framework. However, patching of comments and"OPTIONAL" are to be interpretedprocessing instructions of the root node is allowed. Naturally the removal or addition of a document root element is not allowed asdescribed in RFC 2119, BCP 14 [1] and indicate requirement levels for compliant implementations. The following terms are used in this document: Initial XML document: An initialany valid XML document MUST always contain a single root element. Also note that support for external entities isgoing to be updated with a setbeyond the scope ofpatches. Urpalainen Expires September 7, 2006 [Page 3] Internet-Draftthis framework. 4. Patch OperationsMarch 2006An XML diffdocument: A frame XMLdocumentthatcontains a collection of patch operation elements,namespace declarations and all the document content changes that are needed in order to transform an initial XML document into a new patched XML document. Patched XML document: An XML document that results after applyingincluding one or more <add>, <replace> and <remove> elements. These patch operationsdefined in the XML diff document to the initial XML document. Patch operation: A single change, i.e. awill be applied sequentially in the document order. After the first patchthat is beinghas been applied to update an initial XMLdocument.document, the patched XML document becomes a new Urpalainen Expires February 10, 2008 [Page 6] Internet-Draft Patchoperation element: AnOperations August 2007 independent XML document against which the next patch will be applied. This procedure repeats until all patches have successfully been processed. 4.1. Locating the Target of a Patch Each patch operation elementthat representscontains a 'sel' attribute. The value of this attribute is an XPath selector with a restricted subset of the full XPath 1.0 recommendation. The 'sel' value is used to locate a singlepatch operation. Type definitionunique target node from the initial XML document. This located node pinpoints the target for a change and usually it is anelement: A W3C Schema type definitionelement, which is e.g. either updated itself or some child node(s) are added into it. It MAY also be for instance a comment node, after which some other sibling node(s) are inserted. In any case, it is anelementerror condition if multiple nodes are found during the evaluation of this selector value. The XPath selections of the 'sel' attribute always start from the root node of a document. Thus relative location paths SHOULD be used so thatdescribesthe starting root node selection "/" can be omitted. When locating elements in apatch operation content. In-scope namespace declaration:document tree, a node test can either be a "*" character or a QName. Alist"*" character selects all element children of the context node. Right after the node test, a location step can contain one or more predicates in any order. An attribute value comparison is one ofall in-scope namespace declarations within a context node.the most typical predicates. TheQName expansionstring value ofathe current context nodeis based on mappingor aprefix with one of these declarations. For an element, one namespace bindingchild element mayhavealternatively be used to identify elements in the tree. The character ".", which denotes a current context node selection, is anempty prefix. Positional constraint: A number enclosed with square brackets. Itabbreviated form of "self::node()". Lastly, positional constraints like "[2]" can also be used asa location stepan additional predicate.Located target node: A node which was foundAn XPath 1.0 "id()" node-set function MAY also be used to identify unique elements from theinitial XMLdocumentwithtree. The schema that describes theaid of an XPath selector value. White space text node: A text node which contains only white space. 3. Basic Features and Requirements In this framework, XPath selector values and new datacontentare embedded within XML elements, the namesmodel ofwhich implythe document MUST then use an attribute with the typeof a modification: <add>, <replace> or <remove>. These elements,ID [7] orsynonymously patch operations aswith non-validating XML parsers, an "xml:id" [8] attribute MUST have been used within an instance document. 4.2. Namespace Mangling While the XPath recommendation specifies that prefixes can be used inthis document,location steps, it does not specify how associated namespace URIs aredescribed by defining their schema types withdiscovered during these evaluations. In the patch operation framework QName [4] expansion within a location step is evaluated according to the namespace declarations of theW3C Schema language [6]. XPath selectors pinpointXML diff document. Thus thetargetnamespace URIs fora change and they are expressed as attributes oftheseelements. The child node(s)prefixes are found from the in- scope namespaces of the patch operationelements contain the new data content.element. Ingeneral when applicable, the new content SHOULD be moved unaltered toother words, thepatchedXMLdocument. The specifications utilizing these element types MUST definediff document contains all needed information for QName expansions in order to perform XPath searches from thefullinitial XMLdiff format with an appropriate MIME type [11] and a characterUrpalainen ExpiresSeptember 7, 2006February 10, 2008 [Page4]7] Internet-Draft Patch OperationsMarch 2006 set, e.g. UTF-8 [9]. The partial PIDF format [13] includes this schemaAugust 2007 document. Note: It should be emphasized that prefixes within the XPath selectors MAY be different than those of the initial XML document because the matching of nodes is based on expanded names, i.e. a prefix maps to a namespace URI anddescribes additional definitionsthese URIs and local names MUST be identical. For example, with a selector "p:foo", "p" maps toproduceacomplete XML diff format for partial presence information updates. Asnamespace URI and "foo" is theschema defined inlocal name. In thisdocument does not declare any target namespace,framework, when a node test is "foo" and thetype definitions inheritpatch operation element has an in-scope default namespace declaration, a qualified <foo> element from the initial XML document is being searched. That is, thetargetnamespace URI of theincluding schema. Therefore, additionalexpanded name of the located <foo> element MUST then be identical compared to this default namespacedeclarationsdeclaration. If there's not an in-scope default namespace declaration within theXML diff documents can be avoided. Itevaluation context, an unqualified <foo> element isanticipated that applications using these types will define <add>, <replace> and <remove> elements based on the corresponding type definitionslocated. Note: By contrast, inthis schema. In addition, an application may reference only a subset of these type definitions. A future extension can introduce other operations, e.g. with document oriented models [7]XPath 1.0 a<move> operation and"foo" selector always locates an unqualified <foo> element but in XPath 2.0 [10] also atext node patching algorithm combinedqualified one which is attached with<move> would undoubtedly produce smaller XML diff documents. The instance document elements based on these schema type definitions MUST be well formed and SHOULD be valid.the default namespace declaration. Note: ThefollowingXPath 1.0data model node typesrecommendation specifies "namespace-uri()" and "local-name()" node-set functions which can beadded, replaced or removedused within predicates. These functions may be utilized during XPath evaluations if there are no other means to "register" prefixes withthis framework: elements, attributes, namespaces, comments, texts and processing instructions. The full XML prolog including e.g. XML entities [2] and the root node of an XML document cannotassociated namespace URIs. They can also bepatched accordingused when handling selections where default namespaces are attached tothis framework.elements. However,patching of comments and processing instructions oftheroot node is allowed. Naturallyschema type definitions for these patch operation elements do not allow theremoval or additionusage of these functions. Also elements within the changed data content are usually namespace qualified. For example, when adding adocument rootnew namespace qualified elementis not allowed as any validto the initial XMLdocument MUST always contain a single root element. Also note that support for external entities is beyonddocument, thescopenamespace declaration reference of thisframework. Note: Implementations must thus be based on XML parsers and XPath interpreters that support all XPath 1.0 data model node types exceptnew element belongs first to theroot node of anXML diff document.In additionNaturally after copying or moving this element, the attached namespace MUST refer to a declaration within thelocation capability ofpatched XML document. If this namespace is declared in the patch operation element or within its ascendants, thesenodes, some application programming interfaces are needed for their manipulationreferences MUST thus be changed. Like inpractice. XML documents which are equivalent forXPath, thepurposesmapping ofmany applications MAY differ in their physical representation.these references is based on identical namespace URIs, not prefixes. Theaimnamespace with an identical URI from the in-scope namespaces ofthis document is to describeadeterministic framework where the canonical form with comments [4]context node ofanthe initial XML documentdetermines logical equivalence. For example, white space text nodesMUST beprocessed properly in order to fulfilchosen. However, if overlapping in- scope namespaces exist, i.e., there are several in-scope namespaces with an identical namespace URI, then the namespace with the same prefix MUST be chosen. If an equivalent prefix is not then found, an error occurs. For instance, thisrequirement as white spacekind of overlapping can happen when a namespace qualified attribute isby default significant [4].added while elements are attached Urpalainen ExpiresSeptember 7, 2006February 10, 2008 [Page5]8] Internet-Draft Patch OperationsMarch 2006 4. Patch Operations An XML diff document contains a collection of patch operation elements, including oneAugust 2007 with an identical default namespace declaration. When the new added ormore <add>, <replace> and <remove> elements. These patch operations will be applied sequentially inupdated elements contain namespace declarations, thedocument order. Afternamespace nodes move unaltered from thefirst patch has been applied to update an initialXMLdocument,diff document to the patched XMLdocument becomes a new initial XMLdocument.This procedure repeats until all patches have successfully been processed. In other words,Default namespace declarations can only be added by thisframework does not allow "apply all occurrences"way but prefixed namespace declarations MAY be added or removed with XPath namespace axis semantics shown later inone pass. 4.1. Locating the Target for a Patch Each patch operation element contains a 'sel' attribute. The value ofthisattribute isdocument. Note: In practice, this namespace mangling means that anXPath selector with a restricted subsetXML diff document MUST only know the namespace URIs of qualified nodes, thefull XPath 1.0 recommendation. The 'sel' value is used to locate a single unique target node fromprefixes of the initial XMLdocument. This located node pinpoints the target for a change and usually it is an element, which is e.g. either updated itself or some child node(s) are added into it. It may also be for instance a comment node, after which some other sibling node(s)document areinserted. In any case, it is an error condition if multiple nodesnot significant unless there arefound duringthose overlapping namespace declarations. In other words, regardless whether theevaluationprefixes ofthis selector value. The XPath selectionsqualified elements of the'sel' attribute always start frominitial XML document are empty (default namespace attached) or not, theroot nodeXML diff document may remain the same. 4.3. <add> Element The <add> element represents the addition ofa document. Thus relative location paths SHOULD be used so thatsome new content to thestarting root node selection "/" can be omitted. When locating elements in a document tree,initial XML document: e.g. anode testnew element caneitherbea "*" character or a QName. A "*" character selects all element childrenappended into an existing element. The new data content exists as the child node(s) of thecontext node. Right after<add> element. When adding attributes and namespaces the child nodetest,of the <add> element MUST be alocation step cansingle text node. Otherwise, the <add> element MAY containoneany mixture of element, text, comment ormore predicatesprocessing instruction nodes in any order.An attributeAll children of the <add> element are then copied into an initial XML document. The described namespace mangling procedure applies to added elements, which include all of their attribute, namespace and descendant nodes. The <add> element type has three attributes: 'sel', 'type' and 'pos'. The valuecomparisonof the optional 'type' attribute isoneonly used when adding attributes and namespaces. Then the located target node MUST be an element into which new attributes and namespace declarations are inserted. When the value of this 'type' attribute equals "@attr" themost typical predicates.purpose is to add a new attribute node with the name 'attr'. Thestringvalue of this new 'attr' attribute is thecurrent contexttext nodeor a child element may alternatively be used to identify elements incontent of thetree.<add> element. Thecharacter ".", which denotes a current context node selection, is an abbreviated form of "self::node()". Lastly, positional constraints like "[2]"less frequently used, prefixed, i.e. namespace qualified attributes can also beused as an additional predicate. An XPath 1.0 "id()" node-set function MAY also be used to identify unique elements from the document tree. The schema that describesadded. If thecontent modelvalue of thedocument MUST then use an'type' attributewithequals "namespace::pref" thetype ID [7] or with non-validating XML parsers, an "xml:id" [8] attribute MUST have been used within an instance document. 4.2. Namespace Mangling Whileaim is to add a new "pref" prefixed namespace declaration and theXPath recommendation specifies that prefixes can be used in location steps, it does not specify how associatedtext node content of the <add> element contains the corresponding namespaceURIs areURI. Urpalainen ExpiresSeptember 7, 2006February 10, 2008 [Page6]9] Internet-Draft Patch OperationsMarch 2006 discovered during these evaluations. InAugust 2007 Note: The 'type' attribute is thus also an XPath selector, but it only locates attributes and namespaces. Attribute axis "attribute" has an abbreviated form "@" unlike thepatch operation framework QName [5] expansion within a location step"namespace" axis which doesn't have an abbreviated form. Double colons "::" are used as an axis separator in XPath. The value of the optional 'pos' attribute indicates the positioning of new data content. It isevaluated according tonot used when adding attributes or namespaces. When neither 'type' nor 'pos' attribute exist, thenamespace declarationschildren of theXML diff document. Thus<add> element are then appended as thenamespace URIs for these prefixeslast child node(s) of the located target element. When the value of 'pos' attribute is "prepend" the new node(s) arefound fromadded as thein- scope namespacesfirst child node(s) of thepatch operationlocated target element.In other words,With theXML diff document contains all needed information for QName expansions in order to perform XPath searches fromvalue of "before" theinitial XML document. Note: It shouldadded new node(s) MUST beemphasized that prefixes withintheXPath selectors MAY be different than thoseimmediate preceding sibling node(s) and with "after" the immediate following sibling node(s) of theinitial XML document becauselocated target node. Some examples follow which describe thematchinguse cases of these <add> element attributes. The nodesis based on expanded names, i.e. a prefix maps to aare not namespaceURI and these URIsqualified andlocal names MUST be identical. For example, with a selector "p:foo", "p" maps to a namespace URIprefixes are therefore not used and"foo" isthelocal name. In this framework, when a node testwhole XML diff content is"foo" and thenot shown in these examples, only patch operationelement haselements. Full examples are given in anin-scope default namespace declaration,Appendix A. 4.3.1. Adding an Element An example for an addition of an element: <add sel="doc"><foo id="ert4773">This is aqualified <foo>new child</foo></add> Once the <doc> element has been found from the initial XMLdocumentdocument, a new <foo> element isbeing searched. That is,appended as thenamespace URIlast child node of theexpanded name<doc> element. The located target node: the <doc> element is naturally the root element of thelocatedinitial XML document. The new <foo> elementMUST then be identical compared to this default namespace declaration. If there's not an in-scope default namespace declaration within the evaluation context,contains anunqualified <foo> element is located. Note: By contrast, in XPath 1.0'id' attribute and a"foo" selector always locateschild text node. 4.3.2. Adding anunqualifiedAttribute An example for an addition of an attribute: <add sel="doc/foo[@id='ert4773']" type="@user">Bob</add> This operation adds a new 'user' attribute to the <foo> elementbut in XPath 2.0 [10] also a qualified onewhich was located by using an 'id' attribute value predicate. The value of this new 'user' attribute isattached with"Bob". A similar patched XML document is achieved when using a validating XML parser, if thedefault namespace declaration. Note: The XPath 1.0 recommendation specifies "namespace-uri()"'sel' selector value had been 'id("ert4773")' and"local-name()" node-set functions whichif the data type of the 'id' attribute is "ID" [7]. Urpalainen Expires February 10, 2008 [Page 10] Internet-Draft Patch Operations August 2007 Note: As the 'sel' selector value MAY contain quotation marks, escaped forms: """ or "'" can be used withinpredicates. These functions may be utilized during XPath evaluations if there are no other meansattribute values. However, it is often more appropriate to"register" prefixes with associated namespace URIs. They canuse the apostrophe (') character as shown in these examples. An alternative is alsobe used when handling selections where default namespaces are attachedtoelements. However,interchange theschema type definitionsapostrophes and quotation marks. 4.3.3. Adding a Prefixed Namespace Declaration An example forthese patch operation elements do not allow the usagean addition ofthese functions. Also elements within the changed data content are usuallya prefixed namespacequalified. For example, when addingdeclaration: <add sel="doc" type="namespace::pref">urn:ns:xxx</add> This operation adds a new namespacequalified elementdeclaration to theinitial XML document, the namespace declaration reference<doc> element. The prefix of this newelement belongs first to the XML diff document. Naturally after copying or moving this element,namespace node is thus "pref" and theattachednamespaceMUST refer toURI is "urn:ns:xxx". 4.3.4. Adding Node(s) with the 'pos' Attribute An example for an addition of adeclaration withincomment node: <add sel="doc/foo[@id='ert4773']" pos="before"><!-- comment --></add> This operation adds a new comment node just before thepatched<foo> element as an immediate preceding sibling node. This is also an example how a 'pos' attribute directive can be used. 4.3.5. Adding Multiple Nodes Some complexity arises when so called white space text nodes exist within an initial XML document.If this namespaceThe XPath 1.0 data model requires that a text node MUST not have another text node as an immediate sibling node. For instance, if an add operation isdeclared inlike this: <add sel="doc"> <foo id="ert4773">This is a new child</foo></add> The <add> element has then two child nodes: a white space text node (a linefeed and two spaces) and a <foo> element. If thepatch operationexisting last child of the <doc> elementor withinis a text node, itsascendants, these referencescontent and the white space text node content MUSTthusthen be combined together. Otherwise (white space) text nodes can be added just like elements and thus, the canonical form of the patched XML document easily remains deterministic. As several sibling nodes can be inserted with a single <add> operation, a "pretty printing" style can easily bechanged. Like in XPath,maintained. Still another example about themappinghandling ofthese references is based on identical namespace URIs, not prefixes. The namespace with antext nodes. Consider Urpalainen ExpiresSeptember 7, 2006February 10, 2008 [Page7]11] Internet-Draft Patch OperationsMarch 2006 identical URI from the in-scope namespaces of a contextAugust 2007 this example: <add sel="*/foo/text()[2]" pos="after">new<bar/>elem</add> The second text node child of theinitial XML document MUST be chosen. However, if overlapping in- scope namespaces exist, i.e., there are several in-scope namespaces with an identical namespace URI, then the namespace with the same prefix MUST be chosen. If an equivalent prefix is not then found, an error occurs. For instance, this kind of overlapping can happen when a namespace qualified attribute<foo> element is first located. The addedwhile elements are attached withnew content contains two text nodes and anidentical default namespace declaration. Whenelement. As there can not be immediate sibling text nodes, the located target text node content and the first newadded or updated elements contain namespace declarations,text node content MUST be combined together. In essence, if thenamespace nodes move unaltered from'pos' value had been "before", theXML diff documentsecond new text node content would effectively have been prepended to thepatched XML document. Default namespace declarations can only be added by this way but prefixed namespace declarations MAY be added or removed with XPath namespace axis semantics shown later in this document.located target text node. Note:In practice, this namespace mangling meansIt is still worth noting thatan XML diff document MUST only knowtext nodes MAY contain CDATA sections, thenamespace URIslatter ofqualifiedwhich are not treated as separate nodes. Once these CDATA sections exist within the new text nodes, they SHOULD be moved unaltered to theprefixes ofpatched XML document. While XML entities [2] cannot be patched with this framework, the references to other than predefined internal entities can exist within text nodes or attributes when theinitialXMLdocument are not significant unless there areprolog contains thoseoverlapping namespacedeclarations.In other words, regardless whether the prefixes of qualified elements ofThese references may then be preserved if both theinitialXMLdocument are empty (default namespace attached) or not,diff and the initial XMLdiffdocument have identical declarations within their prologs. Otherwise, references mayremainbe replaced with identical text as long as thesame. 4.3. <add>"canonically equivalent" rule is obeyed. 4.4. <replace> Element The<add><replace> element representsthe addition of some new content to the initial XML document:a replacement operation: e.g. an existing element is updated with a new elementcan be appended intoor anexisting element. Theattribute value is replaced with a newdata content exists as the child node(s) of the <add> element. When adding attributes and namespaces the child node of the <add> element MUST bevalue. This <replace> operation always updates a singletext node. Otherwise, the <add> element can contain any mixture of element, text, commentnode orprocessing instruction nodes in any order. All children of the <add> element are then copied into an initial XML document. The described namespace mangling procedure applies to added elements, which include all of their attribute, namespace and descendant nodes.node content at a time. The<add><replace> element type hasthree attributes: 'sel', 'type' and 'pos'. The value of the optional 'type' attribute isonlyused when adding attributes and namespaces. Thena 'sel' attribute. If the located target nodeMUST be an element into which new attributes and namespace declarations are inserted. When the value of this 'type' attribute equals "@attr" the purposeisto addan element, anew attribute node with the name 'attr'. The value of this new 'attr' attribute iscomment or a processing instruction, then thetext node contentchild of the<add> element. The less frequently used, prefixed, i.e. namespace Urpalainen Expires September 7, 2006 [Page 8] Internet-Draft Patch Operations March 2006 qualified attributes can<replace> element MUST also beadded. If the valueof the'type' attribute equals "namespace::pref" the aim is to add a new "pref" prefixed namespace declaration andsame type. Otherwise the <replace> element MUST have textnodecontentof the <add> element contains the corresponding namespace URI. Note: The 'type'or it MAY be empty when replacing an attributeis thus alsovalue or a text node content. 4.4.1. Replacing anXPath selector, but it only locates attributes and namespaces. Attribute axis "attribute" hasElement An example for a replacement of anabbreviated form "@" unlikeelement: <replace sel="doc/foo[@a='1']"><bar a="2"/></replace> This will update the"namespace" axis<foo> element whichdoesn't have an abbreviated form. Double colons "::" are used ashas anaxis separator in XPath. The value of the optional 'pos''a' attributeindicates the positioning of new data content. Itwith value "1". The located target element isnot used when addingreplaced with the <bar> element. So all descendant nodes, namespace declarations and Urpalainen Expires February 10, 2008 [Page 12] Internet-Draft Patch Operations August 2007 attributesor namespaces. When neither 'type' nor 'pos' attribute exist, the childrenof the<add> elementreplaced <foo> element, if any existed, arethen appended asthus removed. 4.4.2. Replacing an Attribute Value An example for a replacement of an attribute value: <replace sel="doc/@a">new value</replace> This will replace thelast child node(s)'a' attribute content of thelocated target element. When<doc> element with the valueof 'pos' attribute"new value". If the <replace> element is"prepend"empty, thenew node(s) are added as'a' attribute MUST then remain in thefirst child node(s)patched XML document appearing like <doc a=""/>. 4.4.3. Replacing a Namespace Declaration URI An example for a replacement of a namespace URI: <replace sel="doc/namespace::pref">urn:new:xxx</replace> This will replace thelocated target element. With theURI value of"before"'pref' prefixed namespace node with "urn:new:xxx". The parent node of theadded new node(s)namespace declaration MUST be theimmediate preceding sibling node(s) and with "after" the immediate following sibling node(s)<doc> element, otherwise an error occurs. 4.4.4. Replacing a Comment Node An example for a replacement of a comment node: <replace sel="doc/comment()[1]"><!-- This is thelocated targetnew content --></replace> This will replace a comment node.Some examples follow where nodes are not namespace qualified and prefixes are therefore not used.Thewhole XML diff contentlocated target node isnot shown in these examples, only patch operation elements becausethe first comment node child ofsimplicity reasons: <add sel="doc"><foo id="ert4773">Thisthe <doc> element. 4.4.5. Replacing a Processing Instruction Node An example for a replacement of a processing instruction node: <replace sel='doc/processing-instruction("test")'><?test bar="foobar" ?></replace> This will replace the processing instruction node "test" whose parent is the <doc> element. 4.4.6. Replacing a Text Node An example for a replacement of a text node: Urpalainen Expires February 10, 2008 [Page 13] Internet-Draft Patch Operations August 2007 <replace sel="doc/foo/text()[1]">This isa new child</foo></add> Once the <doc> element has been found fromtheinitial XML document, anew<foo> element is appended astext content</ replace> This will replace thelast childfirst text node child of the<doc><foo> element. Thelocated target node:positional constraint "[1]" is not usually needed as the<doc>element content isnaturallyrarely of mixed type [5] where several text node siblings typically exist. If a text node is updated and theroot<replace> elementofis empty, theinitial XML document.text node MUST thus be removed as a text node MUST always have at least one character of data. 4.5. <remove> Element Thenew <foo><remove> elementcontains an 'id' attribute andrepresents achild text node. An example for an additionremoval operation of e.g. anattribute: <add sel="doc/foo[@id='ert4773']" type="@user">Bob</add> This operation adds a new 'user' attribute to the <foo>existing elementwhich was located by usingor an'id' attribute value predicate.attribute. The <remove> element type has two attributes: 'sel' and 'ws'. The value ofthis new 'user'the optional 'ws' attribute is"Bob". A similar patched XML document is achieved when using a validating XML parser, if the 'sel' selector value had been 'id("ert4773")' and ifused to remove thedata typepossible white space text nodes that exist either as immediate following or preceding sibling nodes of the'id'located target node. The usage of 'ws' attribute is"ID" [7]. Urpalainen Expires September 7, 2006 [Page 9] Internet-Draft Patch Operations March 2006 Note: As the 'sel' selector value MAY contain quotation marks, escaped forms: """ or "'" can be used withinonly allowed when removing other types than text, attributevalues. However, itand namespace nodes. If the value of 'ws' isoften more appropriate to use"before", theapostrophe (') character as shown in these examples. An alternativepurpose isalsotointerchangeremove theapostrophes and quotation marks. An example for an addition of a prefixed namespace declaration: <add sel="doc" type="namespace::pref">urn:ns:xxx</add> This operation addsimmediate preceding sibling node which MUST be anew namespace declaration to the <doc> element. The prefix of this new namespacewhite space text nodeis thus "pref"and if thenamespace URIvalue is"urn:ns:xxx"."after", the corresponding following node. If the 'ws' value is "both", both the preceding and following white space text nodes MUST be removed. 4.5.1. Removing an Element An example for a removal of anadditionelement including all ofa comment node: <add sel="doc/foo[@id='ert4773']" pos="before"><!-- comment --></add>its descendant, attribute and namespace nodes: <remove sel="doc/foo[@a='1']" ws="after"/> Thisoperation adds a new comment node just beforewill remove the <foo> element asanwell as the immediateprecedingfollowing siblingnode. Thiswhite space text node of the <foo> element. If the immediate following sibling node isalso an example hownot a'pos' attribute directive can be used. Some complexity arises when so calledwhite space textnodes exist withinnode, aninitial XML document. The XPath 1.0 data model requires thaterror occurs. 4.5.2. Removing an Attribute An example for atextremoval of an attribute node: <remove sel="doc/@a"/> This will remove the 'a' attribute node from the <doc> element. Urpalainen Expires February 10, 2008 [Page 14] Internet-Draft Patch Operations August 2007 4.5.3. Removing a Prefixed Namespace Declaration An example for a removal of a prefixed namespace node: <remove sel="doc/foo/namespace::pref"/> This will remove the 'pref' prefixed namespace node from the <foo> element. Naturally this prefix MUST nothave another textbe associated with any nodeas an immediate siblingprior to the removal of this namespace node.For instance, if an add operation is like this: <add sel="doc"> <foo id="ert4773">This is a new child</foo></add> The <add> element has then two child nodes: a white space textAlso the parent node(a linefeed and two spaces) and aof this namespace declaration MUST be the <foo> element.If4.5.4. Removing a Comment Node An example for a removal of a comment node: <remove sel="doc/comment()[1]"/> This will remove theexisting lastfirst comment node child of the <doc>element iselement. 4.5.5. Removing atext node, its content andProcessing Instruction Node An example for a removal of a processing instruction node: <remove sel='doc/processing-instruction("test")'/> This will remove thewhite space text"test" processing instruction nodecontent MUST then be combined together. Otherwise (white space) text nodes can be added just like elements and thus, the canonical formchild of thepatched XML document easily remains deterministic. As several sibling nodes can be inserted with a single <add> operation,<doc> element. 4.5.6. Removing a"pretty printing" style can easily be maintained. Still anotherText Node An exampleabout the handlingfor a removal of a textnodes. Consider this example: <add sel="*/foo/text()[2]" pos="after">new<bar/>elem</add> The secondnode: <remove sel="doc/foo/text()[1]"/> This will remove the first text node child of the <foo>element is first located. The added new content contains two text nodes and anelement.As Urpalainen Expires September 7, 2006 [Page 10] Internet-Draft Patch Operations March 2006 there can not beWhen removing an element, a comment or a processing instruction node which has immediate preceding and following sibling textnodes,nodes without thelocated target text node content and'ws' directive, thefirst new text nodecontent of these two text nodes MUST be combined together.In essence, if the 'pos' value had been "before", the second newThe latter text nodecontent would effectively have been prepended tothus disappears from thelocated target text node. Note:document. 5. Error Handling It isstill worth noting that text nodes MAY contain CDATA sections, the latteran error condition if any ofwhich are not treated as separate nodes. Once these CDATA sections exist withinthenew text nodes, they SHOULD be moved unaltered to the patched XML document. While XML entities [2] cannot be patched with this framework, the references to other than predefined internal entitiespatch operations canexist within text nodes or attributes when the XML prolog contains those declarations. These references may then be preserved if both the XML diff and the initial XML document have identical declarations within their prologs. Otherwise, references maynot bereplaced with identical text as long as the "canonically equivalent" rule is obeyed. 4.4. <replace> Element The <replace> element representsunambiguously fulfilled. In other words, once areplacement operation: e.g. an existing elementparticular patch operation fails, it isupdated with a new element oranattribute valueerror condition and processing of further Urpalainen Expires February 10, 2008 [Page 15] Internet-Draft Patch Operations August 2007 patch operations isreplaced with a new value. This <replace> operation always updates a single node or node content athardly sensible. Also it is beyond the scope of this document to describe atime. The <replace> element type hasgeneric error response. 6. Usage of Patch Operations An XML diff document SHOULD contain only the nodes which have been modified. However, when there's a'sel' attribute. Iflarge collection of changes it could be desirable to exchange thelocated target nodefull document content instead. How this will be done in practice isan element, a comment or a processing instruction, thenbeyond thechildscope of this document. 7. Usage of Selector Values It is up to the<replace> element MUST also beapplication to decide what kind of selector values to use. Positional element selectors like "*/*[3]/*[2]" provide thesame type. Otherwiseshortest selectors, but care must to taken when using them. When there are several removals of sibling elements, the<replace>positional elementMUST have text content or it MAY be emptyindexes change after each update. Likewise these indexes change whenreplacing annew elements are inserted into the tree. Using names with possible attributevalue or a text node content. Examplespredicates like "doc[@sel='foo']" is usually easier forreplace operations, first a replacement ofanelement: <replace sel="doc/foo[@a='1']"><bar a="2"/></replace> This will update the <foo> element which hasapplication, be it e.g. an'a' attribute with value "1".auto diff tool but it leads to larger diff documents. 8. XML Schema Thelocated target element is replaced with the <bar> element. So all descendant nodes, namespace declarations and attributes of the replaced <foo> element, if any existed, are thus removed. An exampleschema types fora replacement of an attribute value: <replace sel="doc/@a">new value</replace> This will replace the 'a' attribute content ofthe<doc> element withpatch operation elements. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE schema [ <!ENTITY ncname "\i\c*"> <!ENTITY qname "(&ncname;:)?&ncname;"> <!ENTITY aname "@&qname;"> <!ENTITY pos "\[\d+\]"> <!ENTITY attr "\[&aname;='(.)*'\]|\[&aname;="(.)*"\]"> <!ENTITY valueq "\[(&qname;|\.)="(.)*"\]"> <!ENTITY value "\[(&qname;|\.)='(.)*'\]|&valueq;"> <!ENTITY cond "&attr;|&value;|&pos;"> <!ENTITY step "(&qname;|\*)(&cond;)*"> <!ENTITY piq "processing-instruction\(("&ncname;")?\)"> <!ENTITY pi "processing-instruction\(('&ncname;')?\)|&piq;"> <!ENTITY id "id\(('&ncname;')?\)|id\(("&ncname;")?\)"> <!ENTITY com "comment\(\)"> <!ENTITY text "text\(\)"> <!ENTITY nspa "namespace::&ncname;"> <!ENTITY cnodes "(&text;(&pos;)?)|(&com;(&pos;)?)|(π(&pos;)?)"> Urpalainen ExpiresSeptember 7, 2006February 10, 2008 [Page11]16] Internet-Draft Patch OperationsMarch 2006 the value "new value". If the <replace> element is empty, the 'a' attribute MUST then remain in the patchedAugust 2007 <!ENTITY child "&cnodes;|&step;"> <!ENTITY last "&child;|&aname;|&nspa;"> ]> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <xsd:simpleType name="xpath"> <xsd:restriction base="xsd:string"> <xsd:pattern value="(/)?(&step;/)*(&last;)"/> <xsd:pattern value="(/)?&id;((/&step;)*(/&last;))?"/> </xsd:restriction> </xsd:simpleType> <xsd:simpleType name="xpath-add"> <xsd:restriction base="xsd:string"> <xsd:pattern value="(/)?(&step;/)*(&child;)"/> <xsd:pattern value="(/)?&id;((/&step;)*(/&child;))?"/> </xsd:restriction> </xsd:simpleType> <xsd:simpleType name="pos"> <xsd:restriction base="xsd:string"> <xsd:enumeration value="before"/> <xsd:enumeration value="after"/> <xsd:enumeration value="prepend"/> </xsd:restriction> </xsd:simpleType> <xsd:simpleType name="type"> <xsd:restriction base="xsd:string"> <xsd:pattern value="&aname;"/> <xsd:pattern value="&nspa;"/> </xsd:restriction> </xsd:simpleType> <xsd:complexType name="add"> <xsd:complexContent mixed="true"> <xsd:restriction base="xsd:anyType"> <xsd:sequence> <xsd:any processContents="lax" namespace="##any" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> <xsd:attribute name="sel" type="xpath-add" use="required"/> <xsd:attribute name="pos" type="pos"/> <xsd:attribute name="type" type="type"/> Urpalainen Expires February 10, 2008 [Page 17] Internet-Draft Patch Operations August 2007 </xsd:restriction> </xsd:complexContent> </xsd:complexType> <xsd:complexType name="replace"> <xsd:complexContent mixed="true"> <xsd:restriction base="xsd:anyType"> <xsd:sequence> <xsd:any processContents="lax" namespace="##any" minOccurs="0" maxOccurs="1"/> </xsd:sequence> <xsd:attribute name="sel" type="xpath" use="required"/> </xsd:restriction> </xsd:complexContent> </xsd:complexType> <xsd:simpleType name="ws"> <xsd:restriction base="xsd:string"> <xsd:enumeration value="before"/> <xsd:enumeration value="after"/> <xsd:enumeration value="both"/> </xsd:restriction> </xsd:simpleType> <xsd:complexType name="remove"> <xsd:attribute name="sel" type="xpath" use="required"/> <xsd:attribute name="ws" type="ws"/> </xsd:complexType> </xsd:schema> 9. IANA Considerations 9.1. XMLdocument appearing like <doc a=""/>. An example for a replacement ofSchema Registration This section registers anamespacenew XML Schema. URI:<replace sel="doc/namespace::pref">urn:new:xxx</replace> This will replace the URI value of 'pref' prefixed namespace node with "urn:new:xxx". The parent node of the namespace declaration MUSTurn:ietf:params:xml:schema:xml-patch-ops Registrant Contact: IETF, SIMPLE working group, <simple@ietf.org> Jari Urpalainen, <jari.urpalainen@nokia.com> Urpalainen Expires February 10, 2008 [Page 18] Internet-Draft Patch Operations August 2007 10. Security Considerations Information exchanged within these patch operations can be highly sensitive. Thus systems need to protect the<doc> element, otherwise an error occurs. An example for a replacement of a comment node: <replace sel="doc/comment()[1]"><!-- This is the new content --></replace> This will replace a comment node. The located target node is the first comment node child of the <doc> element. An example for a replacementintegrity and confidentiality ofa processing instruction node: <replace sel='doc/processing-instruction("test")'><?test bar="foobar" ?></replace> This will replacethis data. Especially, theprocessing instruction node "test" whose parenttransport protocol once it isthe <doc> element. An example for a replacement ofused SHOULD have capabilities to protect from possible threats. For example, atext node: <replace sel="doc/foo/text()[1]">This is the new text content</ replace> This will replacemalicious man-in-the-middle attack could easily give misinformation. However, all thefirst text node child ofsecurity considerations depend very much on the<foo> element.application which utilizes this framework. 11. Acknowledgments Thepositional constraint "[1]" is not usually needed as the element content is rarely of mixed typeauthor would like to thank Eva Leppanen, Mikko Lonnfors, Aki Niemi, Jonathan Rosenberg, Miguel A. Garcia, Anat Angel, Stephane Bortzmeyer and Dave Crocker for their valuable comments and Ted Hardie for his input and support. 12. References 12.1. Normative References [1] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. [2] "Extensible Markup Language (XML) 1.0 (Fourth Edition)", W3C Recommendation REC-xml-20060816 , August 2006. [3] "XML Path Language (XPath) Version 1.0", W3C Recommendation REC-xpath-19991116 , November 1999. [4] "Namespaces in XML (Second Edition)", W3C Recommendation REC- xml-names-20060816 , August 2006. [5] "XML Schema Part 1: Structures Second Edition", W3C Recommendation REC-xmlschema-1-20041028 , October 2004. [6]where several text node siblings typically exist. If a text node is updated and the <replace> element is empty, the text node MUST thus be removed as a text node MUST always have at least one character of data. 4.5. <remove> Element The <remove> element represents"Canonical XML 1.0", W3C Recommendation REC-xml-c14n-20010315 , March 2001. [7] "XML Schema Part 2: Datatypes Second Edition", W3C Recommendation PER-xmlschema-2-20040318 , October 2004. [8] "xml:id Version 1.0 W3C Recommendation 9 September 2005", W3C Recommendation PR-xml-id-20050712 , September 2005. [9] Yergeau, F., "UTF-8, aremoval operationtransformation format ofe.g. an existing element or an attribute. The <remove> element type has two attributes: 'sel' and 'ws'. TheISO 10646", Urpalainen ExpiresSeptember 7, 2006February 10, 2008 [Page12]19] Internet-Draft Patch OperationsMarch 2006 value of the optional 'ws' attribute is used to remove the possible white space text nodes that exist either as immediate following or preceding sibling nodes of the located target node. The usage of 'ws' attribute is only allowed when removing other types than text, attribute and namespace nodes. If the value of 'ws' is "before", the purpose is to remove the immediate preceding sibling node which MUST be a white space text node and if the value is "after", the corresponding following node. If the 'ws' value is "both", both the precedingAugust 2007 RFC 2279, January 1998. 12.2. Informative References [10] "XML Path Language (XPath) Version 2.0", W3C Recommendation 23 , January 2007. [11] Murata, M., "XML media types", RFC 3023, January 2001. [12] Rosenberg, J., "The Extensible Markup Language (XML) Configuration Access Protocol (XCAP)", RFC 4825, May 2007. [13] Roach, A., "Session Initiation Protocol (SIP)-Specific Event Notification", RFC 3265, June 2002. [14] Lonnfors, M., Leppanen, E., Khartabil, H., andfollowing white space text nodes MUST be removed. ExamplesJ. Urpalainen, "Presence Information Data format (PIDF) Extension forremove operations, first a removal ofPartial Presence", draft-ietf-simple-partial-pidf-format-08 (work in progress), November 2006. [15] Rosenberg, J., "An Extensible Markup Language (XML) Document Format For Indicating Changes in XML Configuration Access Protocol (XCAP) Resources", draft-ietf-simple-xcap-diff-05, March 2007. [16] Niemi, A., "Session Initiation Protocol (SIP) Extension for Event State Publication", RFC 3903, October 2004. Appendix A. Informative Examples All following examples assume anelementimaginary XML diff document includingall of its descendant, attribute and namespace nodes: <remove sel="doc/foo[@a='1']" ws="after"/> This will remove the <foo> element as well as the immediate following sibling white space text node of the <foo> element. If the immediate following sibling node is not a white space text node,these patch operation elements. A.1. Adding anerror occurs.Element An examplefor a removal of an attribute node: <remove sel="doc/@a"/> This will remove the 'a' attribute node from theinitial XML document: <?xml version="1.0" encoding="UTF-8"?> <doc>element. An example for a removal of<note>This is anamespace node: <remove sel="doc/foo/namespace::pref"/> This will remove the 'pref' prefixed namespace node from the <foo> element. Naturally this prefix MUST not be associated with any node prior to the removal of this namespace node. Also the parent node of this namespace declaration MUST be the <foo> element.sample document</note> </doc> An XML diff document: Urpalainen Expires February 10, 2008 [Page 20] Internet-Draft Patch Operations August 2007 <?xml version="1.0" encoding="UTF-8"?> <diff> <add sel="doc"><foo id="ert4773">This is a new child</foo></add> </diff> A result XML document: <?xml version="1.0" encoding="UTF-8"?> <doc> <note>This is a sample document</note> <foo id="ert4773">This is a new child</foo></doc> A.2. Adding an Attribute An exampleforinitial XML document: <?xml version="1.0" encoding="UTF-8"?> <doc> <note>This is aremoval ofsample document</note> <foo id="ert4773">This is acomment node: <remove sel="doc/comment()[1]"/> This will remove the first comment node child of thenew child</foo></doc> An XML diff document: <?xml version="1.0" encoding="UTF-8"?> <diff> <add sel="doc/foo[@id='ert4773']" type="@user">Bob</add> </diff> A result XML document: <?xml version="1.0" encoding="UTF-8"?> <doc>element.<note>This is a sample document</note> <foo id="ert4773" user="Bob">This is a new child</foo></doc> A.3. Adding a Prefixed Namespace Declaration An exampleforinitial XML document: <?xml version="1.0" encoding="UTF-8"?> <doc> <note>This is aremoval ofsample document</note> <foo id="ert4773">This is aprocessing instruction node: <remove sel='doc/processing-instruction("test")'/> This will remove the "test" processing instruction node child of the <doc> element.new child</foo></doc> Urpalainen ExpiresSeptember 7, 2006February 10, 2008 [Page13]21] Internet-Draft Patch OperationsMarch 2006August 2007 Anexample for a removal ofXML diff document: <?xml version="1.0" encoding="UTF-8"?> <diff> <add sel="doc" type="namespace::pref">urn:ns:xxx</add> </diff> A result XML document: <?xml version="1.0" encoding="UTF-8"?> <doc xmlns:pref="urn:ns:xxx"> <note>This is atext node: <remove sel="doc/foo/text()[1]"/> This will remove the first text node child of the <foo> element. When removing an element,sample document</note> <foo id="ert4773">This is acomment ornew child</foo></doc> A.4. Adding aprocessing instruction node which has immediate preceding and following sibling text nodes without the 'ws' directive, the content of these two text nodes MUST be combined together. The latter text node thus disappears from the document. 5. Error Handling It is an error condition if any ofComment Node with thepatch operations can not be unambiguously fulfilled. In other words, once a particular patch operation fails, it'pos' Attribute An example initial XML document: <?xml version="1.0" encoding="UTF-8"?> <doc> <note>This isan error condition and processing of further patch operationsa sample document</note> <foo id="ert4773">This ishardly sensible. Also ita new child</foo></doc> An XML diff document: <?xml version="1.0" encoding="UTF-8"?> <diff> <add sel="doc/foo[@id='ert4773']" pos="before"><!-- comment --></add> </diff> A result XML document: <?xml version="1.0" encoding="UTF-8"?> <doc> <note>This isbeyond the scope of this document to describeageneric error response. 6. Usage ofsample document</note> <!-- comment --><foo id="ert4773">This is a new child</foo></doc> A.5. Adding Multiple Nodes An example initial XML document: Urpalainen Expires February 10, 2008 [Page 22] Internet-Draft Patch Operations August 2007 <?xml version="1.0" encoding="UTF-8"?> <doc> <note>This is a sample document</note> </doc> An XML diffdocument SHOULD contain only the nodes which have been modified. However, when there'sdocument: <?xml version="1.0" encoding="UTF-8"?> <diff> <add sel="doc"> <foo id="ert4773">This is alarge collection of changes it MAY be desirable to exchange the full document content instead. How this will be done in practicenew child</foo></add> </diff> A result XML document: <?xml version="1.0" encoding="UTF-8"?> <doc> <note>This isbeyond the scope of this document. 7. Usage of Selector Values Ita sample document</note> <foo id="ert4773">This isup to the application to decide the verbosity model for selector values. Positional element selectors like "*/*[3]/*[2]" provide the shortest selectors, but care must to taken when using them. When there are several removals of sibling elements, the positional element indexes change after each update. Likewise these indexes change whena newelements are inserted into the tree. Using names with possible attribute predicates like "doc[@sel='foo']" is usually easier for an application, be it e.g.child</foo></doc> A.6. Replacing anauto diff tool but it leads to larger diff documents. 8. Full ExampleElement An example initial XMLdocument where namespace qualified elements exist:document: <?xml version="1.0" encoding="UTF-8"?> <doc> <foo a="1">This is a sample document</foo> </doc> An XML diff document: <?xml version="1.0" encoding="UTF-8"?> <diff> <replace sel="doc/foo[@a='1']"><bar a="2"/></replace> </diff> A result XML document: <?xml version="1.0" encoding="UTF-8"?> <doc> <bar a="2"/> </doc> Urpalainen ExpiresSeptember 7, 2006February 10, 2008 [Page14]23] Internet-Draft Patch OperationsMarch 2006August 2007 A.7. Replacing an Attribute Value An example initial XML document: <?xml version="1.0" encoding="UTF-8"?> <docxmlns="urn:ietf:params:xml:ns:xxx" xmlns:z="urn:ietf:params:xml:ns:yyy"> <note>Thisa="test"> <foo a="1">This is a sampledocument</note> <elem a="foo"> <child/> </elem> <elem a="bar"> <z:child/> </elem>document</foo> </doc> AnimaginaryXML diffdocument where prefix "p" corresponds the targetNamespace of this imaginary schema:document: <?xml version="1.0" encoding="UTF-8"?><p:diff xmlns="urn:ietf:params:xml:ns:xxx" xmlns:y="urn:ietf:params:xml:ns:yyy" xmlns:p="urn:ietf:params:xml:ns:diff"> <p:add sel="doc/elem[@a='foo']"> <!-- This<diff> <replace sel="doc/@a">new value</replace> </diff> A result XML document: <?xml version="1.0" encoding="UTF-8"?> <doc a="new value"> <foo a="1">This is anew child --> <child id="ert4773"> <y:node/> </child> </p:add> <p:replace sel="doc/note/text()">Patched doc</p:replace> <p:remove sel="*/elem[@a='bar']/y:child" ws="both"/> <p:add sel="*/elem[@a='bar']" type="@b">new attr</p:add> </p:diff> One possible form of thesample document</foo> </doc> A.8. Replacing a Namespace Declaration URI An example initial XML document: <?xml version="1.0" encoding="UTF-8"?> <doc xmlns:pref="urn:test"> <foo a="1">This is a sample document</foo> </doc> An XML diff document: <?xml version="1.0" encoding="UTF-8"?> <diff> <replace sel="doc/namespace::pref">urn:new:xxx</replace> </diff> A result XMLdocument after applying the patches:document: Urpalainen ExpiresSeptember 7, 2006February 10, 2008 [Page15]24] Internet-Draft Patch OperationsMarch 2006August 2007 <?xml version="1.0" encoding="UTF-8"?> <docxmlns="urn:ietf:params:xml:ns:xxx" xmlns:z="urn:ietf:params:xml:ns:yyy"> <note>Patched doc</note> <elem a="foo"> <child/> <!-- Thisxmlns:pref="urn:new:xxx"> <foo a="1">This is anew childsample document</foo> </doc> A.9. Replacing a Comment Node An example initial XML document: <?xml version="1.0" encoding="UTF-8"?> <doc xmlns:pref="urn:test"> <foo a="1">This is a sample document</foo> <!-- comment --><child id="ert4773"> <z:node/> </child> </elem> <elem a="bar" b="new attr"/></doc>The <node> and removed <child> element prefixes within theAn XML diffdocument are different than what aredocument: <?xml version="1.0" encoding="UTF-8"?> <diff> <replace sel="doc/comment()[1]"><!-- This is the"identical" namespace declarations innew content --></replace> </diff> A result XML document: <?xml version="1.0" encoding="UTF-8"?> <doc xmlns:pref="urn:test"> <foo a="1">This is a sample document</foo> <!-- This is the new content --> </doc> A.10. Replacing a Processing Instruction Node An example initial XMLdocument. If thedocument: <?xml version="1.0" encoding="UTF-8"?> <doc> <foo a="1">This is a sample document</foo> <?test foo="bar"?> </doc> An XML diff document: Urpalainen Expires February 10, 2008 [Page 25] Internet-Draft Patch Operations August 2007 <?xml version="1.0" encoding="UTF-8"?> <diff> <replace sel='doc/processing-instruction("test")' ><?test bar="foobar"?></replace> </diff> A result XML document: <?xml version="1.0" encoding="UTF-8"?> <doc> <foo a="1">This is a sample document</foo> <?test bar="foobar"?> </doc> A.11. Replacing a Text Node An example initial XMLdocument had useddocument: <?xml version="1.0" encoding="UTF-8"?> <doc> <foo a="1">This is aprefixed namespace declaration instead of the default one, thesample document</foo> </doc> An XML diffdocument could still have beendocument: <?xml version="1.0" encoding="UTF-8"?> <diff> <replace sel="doc/foo/text()[1]" >This is thesame. The addednewqualified elements would just have inherited that prefix. 9.text content</replace></diff> A result XMLSchema The schema types for the patch operation elements.document: <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE schema [ <!ENTITY ncname "[^:\I][^:\C]*"> <!ENTITY qname "(&ncname;:)?&ncname;"> <!ENTITY aname "@&qname;"> <!ENTITY pos "\[\d+\]"> <!ENTITY attr "\[&aname;='(.)*'\]|\[&aname;="(.)*"\]"> <!ENTITY valueq "\[(&qname;|\.)="(.)*"\]"> <!ENTITY value "\[(&qname;|\.)='(.)*'\]|&valueq;"> <!ENTITY cond "&attr;|&value;|&pos;"> <!ENTITY step "(&qname;|\*)(&cond;)*"> <!ENTITY piq "processing-instruction\(("&ncname;")?\)"> <!ENTITY pi "processing-instruction\(('&ncname;')?\)|&piq;"> <!ENTITY id "id\(('&ncname;')?\)|id\(("&ncname;")?\)"> <!ENTITY com "comment\(\)"> <!ENTITY<doc> <foo a="1">This is the new text"text\(\)"> <!ENTITY nspa "namespace::&ncname;"> <!ENTITY child "&step;|&com;(&pos;)?|&text;(&pos;)?|π(&pos;)?"> <!ENTITY last "&child;|&aname;|&nspa;"> ]>content</foo> </doc> A.12. Removing an Element An example initial XML document: Urpalainen ExpiresSeptember 7, 2006February 10, 2008 [Page16]26] Internet-Draft Patch OperationsMarch 2006 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <xsd:simpleType name="xpath"> <xsd:restriction base="xsd:string"> <xsd:pattern value="(/)?(&step;/)*(&last;)"/> <xsd:pattern value="(/)?&id;((/&step;)*(/&last;))?"/> </xsd:restriction> </xsd:simpleType> <xsd:simpleType name="xpath-add"> <xsd:restriction base="xsd:string"> <xsd:pattern value="(/)?(&step;/)*(&child;)"/> <xsd:pattern value="(/)?&id;((/&step;)*(/&child;))?"/> </xsd:restriction> </xsd:simpleType> <xsd:simpleType name="pos"> <xsd:restriction base="xsd:string"> <xsd:enumeration value="before"/> <xsd:enumeration value="after"/> <xsd:enumeration value="prepend"/> </xsd:restriction> </xsd:simpleType> <xsd:simpleType name="type"> <xsd:restriction base="xsd:string"> <xsd:pattern value="&aname;"/> <xsd:pattern value="&nspa;"/> </xsd:restriction> </xsd:simpleType> <xsd:complexType name="add"> <xsd:complexContent mixed="true"> <xsd:restriction base="xsd:anyType"> <xsd:sequence> <xsd:any processContents="lax" namespace="##any" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> <xsd:attribute name="sel" type="xpath-add" use="required"/> <xsd:attribute name="pos" type="pos"/> <xsd:attribute name="type" type="type"/> </xsd:restriction> </xsd:complexContent> </xsd:complexType>August 2007 <?xml version="1.0" encoding="UTF-8"?> <doc> <foo a="1">This is a sample document</foo> </doc> An XML diff document: <?xml version="1.0" encoding="UTF-8"?> <diff> <remove sel="doc/foo[@a='1']" ws="after"/> </diff> A result XML document: <?xml version="1.0" encoding="UTF-8"?> <doc> </doc> A.13. Removing an Attribute An example initial XML document: <?xml version="1.0" encoding="UTF-8"?> <doc a="foo"> <foo a="1">This is a sample document</foo> </doc> An XML diff document: <?xml version="1.0" encoding="UTF-8"?> <diff> <remove sel="doc/@a"/> </diff> A result XML document: <?xml version="1.0" encoding="UTF-8"?> <doc> <foo a="1">This is a sample document</foo> </doc> Urpalainen ExpiresSeptember 7, 2006February 10, 2008 [Page17]27] Internet-Draft Patch OperationsMarch 2006 <xsd:complexType name="replace"> <xsd:complexContent mixed="true"> <xsd:restriction base="xsd:anyType"> <xsd:sequence> <xsd:any processContents="lax" namespace="##any" minOccurs="0" maxOccurs="1"/> </xsd:sequence> <xsd:attribute name="sel" type="xpath" use="required"/> </xsd:restriction> </xsd:complexContent> </xsd:complexType> <xsd:simpleType name="ws"> <xsd:restriction base="xsd:string"> <xsd:enumeration value="before"/> <xsd:enumeration value="after"/> <xsd:enumeration value="both"/> </xsd:restriction> </xsd:simpleType> <xsd:complexType name="remove"> <xsd:attribute name="sel" type="xpath" use="required"/> <xsd:attribute name="ws" type="ws"/> </xsd:complexType> </xsd:schema> 10. IANA Considerations 10.1.August 2007 A.14. Removing a Prefixed Namespace Declaration An example initial XMLSchema Registration This section registersdocument: <?xml version="1.0" encoding="UTF-8"?> <doc> <foo a="1" xmlns:pref="urn:test" >This is anewsample document</foo> <!-- comment --> </doc> An XMLSchema. URI: urn:ietf:params:xml:schema:xml-patch-ops Registrant Contact: IETF, SIMPLE working group, <simple@ietf.org> Jari Urpalainen, <jari.urpalainen@nokia.com> 11. Security Considerations Information exchanged within these patch operations can be highly sensitive. Thus systems need to protect the integrity anddiff document: <?xml version="1.0" encoding="UTF-8"?> <diff> <remove sel="doc/foo/namespace::pref"/> </diff> A result XML document: <?xml version="1.0" encoding="UTF-8"?> <doc> <foo a="1">This is a sample document</foo> <!-- comment --> </doc> A.15. Removing a Comment Node An example initial XML document: <?xml version="1.0" encoding="UTF-8"?> <doc> <foo a="1">This is a sample document</foo> <!-- comment --> </doc> An XML diff document: <?xml version="1.0" encoding="UTF-8"?> <diff> <remove sel="doc/comment()[1]" ws="after"/> </diff> Urpalainen Expires February 10, 2008 [Page 28] Internet-Draft Patch Operations August 2007 A result XML document: <?xml version="1.0" encoding="UTF-8"?> <doc> <foo a="1">This is a sample document</foo> </doc> A.16. Removing a Processing Instruction Node An example initial XML document: <?xml version="1.0" encoding="UTF-8"?> <doc> <foo a="1">This is a sample document</foo> <?test?> </doc> An XML diff document: <?xml version="1.0" encoding="UTF-8"?> <diff> <remove sel='doc/processing-instruction("test")'/> </diff> A result XML document: <?xml version="1.0" encoding="UTF-8"?> <doc> <foo a="1">This is a sample document</foo> </doc> A.17. Removing a Text Node An example initial XML document: <?xml version="1.0" encoding="UTF-8"?> <doc> <foo a="1">This is a sample document</foo> </doc> An XML diff document: Urpalainen ExpiresSeptember 7, 2006February 10, 2008 [Page18]29] Internet-Draft Patch OperationsMarch 2006 confidentiality of this data. Especially, the transport protocol once it is used SHOULD have capabilities to protect from possible threats. For example, a malicious man-in-the-middle attack could easily give misinformation. However, all the security considerations depend very much on the application which utilizes this framework. 12. Acknowledgments The author would like to thank Eva Leppanen, Mikko Lonnfors, Aki Niemi, Jonathan Rosenberg, Miguel A. Garcia, Anat Angel and Stephane Bortzmeyer for their valuable comments and Ted Hardie for his input and support. 13. References 13.1. Normative References [1] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. [2] "Extensible Markup Language (XML) 1.0 (Third Edition)", W3C Recommendation REC-xml-20040204 , February 2004. [3] "XML Path Language (XPath) Version 1.0", W3C Recommendation REC- xpath-19991116 , November 1999. [4] "CanonicalAugust 2007 <?xml version="1.0" encoding="UTF-8"?> <diff> <remove sel="doc/foo/text()[1]"/> </diff> A result XML1.0", W3C Recommendation REC-xml-c14n-20010315 , March 2001. [5] "Namespaces in XML", W3C Recommendation REC-xml-names-19990114 , January 1999. [6] "XML Schema Part 1: Structures Second Edition", W3C Recommendation REC-xmlschema-1-20041028 , October 2004. [7] "XML Schema Part 2: Datatypes Second Edition", W3C Recommendation PER-xmlschema-2-20040318 , October 2004. [8] "xml:id Version 1.0 W3C Recommendation 9 September 2005", W3C Recommendation PR-xml-id-20050712 , September 2005. [9] Yergeau, F., "UTF-8,document: <?xml version="1.0" encoding="UTF-8"?> <doc> <foo a="1"/> </doc> A.18. Several Patches With Namespace Mangling An example initial XML document where namespace qualified elements exist: <?xml version="1.0" encoding="UTF-8"?> <doc xmlns="urn:ietf:params:xml:ns:xxx" xmlns:z="urn:ietf:params:xml:ns:yyy"> <note>This is atransformation formatsample document</note> <elem a="foo"> <child/> </elem> <elem a="bar"> <z:child/> </elem> </doc> An imaginary XML diff document where prefix "p" corresponds the targetNamespace ofISO 10646", RFC 2279, January 1998.this imaginary schema: Urpalainen ExpiresSeptember 7, 2006February 10, 2008 [Page19]30] Internet-Draft Patch OperationsMarch 2006 13.2. Informative References [10] "XML Path Language (XPath) Version 2.0", W3C Candidate Recommendation 3 20051103 , November 2005. [11] Murata, M., "XML media types", RFC 3023, January 2001. [12] Roach, A., "Session Initiation Protocol (SIP)-Specific Event Notification", RFC 3265, June 2002. [13] Lonnfors, M., Leppanen, E., Khartabil, H.,August 2007 <?xml version="1.0" encoding="UTF-8"?> <p:diff xmlns="urn:ietf:params:xml:ns:xxx" xmlns:y="urn:ietf:params:xml:ns:yyy" xmlns:p="urn:ietf:params:xml:ns:diff"> <p:add sel="doc/elem[@a='foo']"> <!-- This is a new child --> <child id="ert4773"> <y:node/> </child> </p:add> <p:replace sel="doc/note/text()">Patched doc</p:replace> <p:remove sel="*/elem[@a='bar']/y:child" ws="both"/> <p:add sel="*/elem[@a='bar']" type="@b">new attr</p:add> </p:diff> One possible form of the result XML document after applying the patches: <?xml version="1.0" encoding="UTF-8"?> <doc xmlns="urn:ietf:params:xml:ns:xxx" xmlns:z="urn:ietf:params:xml:ns:yyy"> <note>Patched doc</note> <elem a="foo"> <child/> <!-- This is a new child --> <child id="ert4773"> <z:node/> </child> </elem> <elem a="bar" b="new attr"/> </doc> The <node> andJ. Urpalainen, "Presence Information Data format (PIDF) Extension for Partial Presence", draft-ietf-simple-partial-pidf-format-06 (work in progress), March 2006. [14] Rosenberg, J., "An Extensible Markup Language (XML) Document Format For Indicating Changes inremoved <child> element prefixes within the XMLConfiguration Access Protocol (XCAP) Resources", draft-ietf-simple-xcap-diff-0x (workdiff document are different than what are the "identical" namespace declarations inprogress), ? 2006. [15] Rosenberg, J., "The Extensible Markup Language (XML) Configuration Access Protocol (XCAP)", draft-ietf-simple-xcap-08, October 2005. [16] Peterson, J., "Common Profile for Presence (CPP)", RFC 3859, August 2004. [17] Sugano, H., "CPIM presence information data format", RFC 3863, May 2003. [18] Niemi, A., "Session Initiation Protocol (SIP) Extension for Event State Publication", RFC 3903, October 2004.the initial XML document. If the initial XML document had used a prefixed namespace declaration instead of the default one, the XML diff document could still have been the same. The added new qualified elements would just have inherited that prefix. Urpalainen ExpiresSeptember 7, 2006February 10, 2008 [Page20]31] Internet-Draft Patch OperationsMarch 2006August 2007 Author's Address Jari Urpalainen NokiaResearch CenterItamerenkatu 11-13 Helsinki 00180 Finland Phone: +358 7180 37686 Email: jari.urpalainen@nokia.com Urpalainen ExpiresSeptember 7, 2006February 10, 2008 [Page21]32] Internet-Draft Patch OperationsMarch 2006August 2007 Full Copyright Statement Copyright (C) The IETF Trust (2007). This document is subject to the rights, licenses and restrictions contained in BCP 78, and except as set forth therein, the authors retain all their rights. This document and the information contained herein are provided on an "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Intellectual PropertyStatementThe IETF takes no position regarding the validity or scope of any Intellectual Property Rights or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; nor does it represent that it has made any independent effort to identify any such rights. Information on the procedures with respect to rights in RFC documents can be found in BCP 78 and BCP 79. Copies of IPR disclosures made to the IETF Secretariat and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users of this specification can be obtained from the IETF on-line IPR repository at http://www.ietf.org/ipr. The IETF invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights that may cover technology that may be required to implement this standard. Please address the information to the IETF at ietf-ipr@ietf.org.Disclaimer of Validity This document and the information contained herein are provided on an "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Copyright Statement Copyright (C) The Internet Society (2006). This document is subject to the rights, licenses and restrictions contained in BCP 78, and except as set forth therein, the authors retain all their rights.Acknowledgment Funding for the RFC Editor function iscurrentlyprovided by theInternet Society.IETF Administrative Support Activity (IASA). Urpalainen ExpiresSeptember 7, 2006February 10, 2008 [Page22]33] ----