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 37<br />

1 <br />

2 <br />

3 12.99<br />

4 <br />

5 <br />

Figure 2.17: XUpdate update operation<br />

Copying and moving nodes<br />

XUpdate allows to bind the result of an XPath expression to a variable. In the<br />

following example a name of an item is bound to a variable i and the variable is<br />

inserted at another place. The value of the variable is addressed with $i. This way<br />

one can copy a node in a document.<br />

1 <br />

2 <br />

3 <br />

4 <br />

5 <br />

7 <br />

Figure 2.18: XUpdate operation for copying nodes<br />

It is possible to move a node from one position to another if the node is bound to<br />

a variable and deleted before reinserted. This is shown in the next example.<br />

1 <br />

2 <br />

3 <br />

4 <br />

5 <br />

6 <br />

8 <br />

Figure 2.19: XUpdate operation for moving nodes

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

Saved successfully!

Ooh no, something went wrong!