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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

36 CHAPTER 2. FUNDAMENTALS<br />

1 <br />

2 <br />

3 <br />

4 item505<br />

5 DVD Recorder<br />

6 Paris , France<br />

7 1<br />

8 Cash<br />

9 <br />

10 This is a brand new DVD Recorder<br />

11 <br />

12 <br />

13 <br />

14 <br />

Figure 2.14: XUpdate append operation with complex content<br />

Deletion nodes<br />

The deletion of nodes is performed using XUpdate’s remove command. The node<br />

d to be deleted is selected with a normal XPath expression. Nodes that are descendants<br />

of d are deleted as well because without d they cannot be reached anymore<br />

from the document’s root.<br />

1 <br />

2 <br />

3 <br />

Figure 2.15: XUpdate remove operation<br />

Renaming nodes<br />

Nodes can be assigned a new name using the rename command. This modification<br />

does not affect the content of an element. In the example all description<br />

elements are renamed to desc.<br />

1 <br />

2 <br />

3 desc<br />

4 <br />

5 <br />

Figure 2.16: XUpdate rename operation<br />

Changing the content of nodes<br />

In contrast to the previous operation the update command changes the content<br />

of an element without affecting its name. The XUpdate expression in the example<br />

changes the price of all items that cost 14.99.

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

Saved successfully!

Ooh no, something went wrong!