30.08.2014 Views

url - Universität zu Lübeck

url - Universität zu Lübeck

url - Universität zu Lübeck

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

2.4. XUPDATE: XML MODIFICATION LANGUAGE 35<br />

2.4 XUpdate: XML Modification Language<br />

With XPath and XQuery we are able to select nodes and create an XML output<br />

with content from an XML document. Modifications in an existing document can<br />

be performed neither with XPath nor XQuery. With XSLT [129] we can transform<br />

one document A into a document B and perform some changes to B. But because<br />

XSLT works like a stylesheet the modifications do not take place in the original<br />

document. Furthermore, XSLT is Turing-complete and can be regarded as a cryptic<br />

but full programming language that does not allow comfortable ad-hoc queries<br />

like SQL for instance.<br />

In this thesis XUpdate [134] is presented as a proposal for an XML modification<br />

language comparable to SQL. Although XUpdate relies strongly on XPath it<br />

was not designed by the W3C. The latest XUpdate Working Draft was published<br />

in 2000 by the XML:DB Initiative. No enhancement or updates of XUpdate were<br />

presented recently. Nonetheless, XUpdate is used by some XML database management<br />

systems like XIndice [8]. A successor project of XUpdate is Lexus [6], an<br />

update language also using XML syntax and XPath for navigation and selection.<br />

In this thesis we give a brief and informal introduction to XUpdate - as one representative<br />

of an ad-hoc XML modification language. Basically, there are six different<br />

types of modifications that are presented in the following by using examples.<br />

For the reason of simplicity, elements and attributes are summarized to nodes.<br />

Constructing and adding new nodes<br />

XUpdate allows to add one or multiple new nodes to an existing document. The<br />

insert position can be before or after a designated node or the new node(s) may be<br />

appended to a list of existing nodes. This is shown in the next two examples.<br />

1 <br />

2 <br />

3 Harddisks<br />

4 <br />

5 <br />

Figure 2.13: XUpdate append operation<br />

As one can see XUpdate expressions are well-formed XML documents themselves.<br />

The root-node is an element called modifications that belongs to the namespace<br />

⁀xupdate. The second line selects the /site/categories element and adds one<br />

new category element with the value Harddisks. In this command an implicit<br />

element creation takes place.<br />

The second example inserts a full XML fragment consisting of one item-node with<br />

an attribute and a complex content.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!