Download presentation
Presentation is loading. Please wait.
Published byMorgan Charles Modified over 9 years ago
1
XML Patch Operations based on XPath selectors Jari Urpalainen IETF62 Minneapolis
2
Short overview ● Purpose was to remove the overlapping parts of xcap- diff and partial-pidf which reference patch-ops ● ~XCAP PUT and DELETE semantics. Patch operations are embedded within a transported XML document ● Uses XPath 1.0 compatible selectors ● Combines several requests:, and with optional data onto a single XML doc ● XML Schema defines only types without any targetNamespace -> the elements inherit the namespace of the including Schema
3
Changes ● The names in location steps are fully namespace qualified. ● The framing document (xcap-diff, pidf-diff etc.) carries all the namespace definitions that are needed to apply the patch requests ● The added or modified data content is also fully namespace qualified.
4
Open Issues/BUGS ● Whitespace text node handling in and ● In addition to above lack of XPath data model nodes: namespaces, comments and processing instructions ● Lack of the ability to say: I want to add these nodes immediately before/after this element that already exist within the patched document
5
Adding namespace definitions ● namespace axis of XPath 1.0 does the trick urn:xml:ns:something ● value of “sel” selects the element where the namespace definition will be added (similar to adding an attribute with “@”) urn:xml:ns:something ● value of “sel” selects the namespace node
6
● except attribute and namespace nodes this will always (by default) append elements, text nodes, comments and processing instructions as the last child(ren) ● This allows an easy handling of whitespace text nodes as well as several siblings at the same time
7
parameters ● the value of 'sel' attribute selects a single unique element from the patched doc ● 'pos' attribute: “to” [default], “before”, “after” ● “before” = immediate preceding sibling node ● “after” = immediate following sibling node ● “to” = last child(ren) node or attribute/namespace ● 'type' attribute; values: node() [default], text(), @attr, namespace::prefix ● child element(s) or text content of = the new/updated XML fragment(s) or values for ns/attr
8
Add before and after ● XPath 1.0 defines axises: preceding-sibling and following-sibling which could be used: This is a comment ● instead a much simpler model using “pos” attribute can be used:
9
● Only one “sel” selector (must locate a unique node) ● Last location step includes comment(), processing- instruction(“x”) and text(). new attr value urn:new This is a new comment bar="foobar" This is the new text content
10
● whitespace text nodes somewhat problematic A. B. C. The proposed model (similar to C, but simpler): ● in addition to 'sel' an optional whitespace attribute 'ws': "before", "after", "both", "none" [default]
11
<!DOCTYPE document [ ]> <xsd:schema...
12
Impact on xcap-diff & pidf-diff etc. ● Common model for applying XML changes ● XML Schemas include patch-ops which is only a framework for patch operations ● Content-Types are defined according to the including schema within xcap-diff and pidf-diff etc. ● As these operations describe the model to patch the full XPath 1.0 data model node types, applications may either extend or restrict these as desired
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.