02.06.2013 Views

XML Demystified

XML Demystified

XML Demystified

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.

138<br />

<strong>XML</strong> Demystifi ed<br />

<br />

<br />

602498678299<br />

U2<br />

How to Dismantle an Atomic Bomb<br />

<br />

<br />

<br />

<br />

Here’s what the XQuery writes to the output.html file, and Figure 9-4 shows the<br />

result when it’s displayed in a browser.<br />

Retrieving the Value of an Attribute<br />

and the Attribute Name<br />

When you use the @ symbol followed by the attribute name without calling the<br />

data() function, an XQuery can return the name of the attribute, along with its value,<br />

as we illustrate here:<br />

{$cd/@upc}<br />

Figure 9-4 Here’s how the UPC attribute appears when the output.html fi le is displayed<br />

in a browser.

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

Saved successfully!

Ooh no, something went wrong!