Java Reference
In-Depth Information
Listing 13-4. A Sample XML Document
<?xml version="1.0" encoding="UTF-8"?>
<!-- A simple weather example -->
<weather city="Berkeley" state="CA" country="USA">
<temperatures units="F">
<temperature type="high">76</temperature>
<temperature type="low">56</temperature>
<temperature type="current">72</temperature>
</temperatures>
<wind>
<direction units="compass">ENE</direction>
<speed units="MPH">5</speed></wind>
<precipitation probability="0" type="rain" units="in"/>
<text>
<when time="today">
Mostly cloudy in the morning then becoming mostly sunny.
Patchy fog in the morning. Highs in the 70s to lower 80s.
Afternoon seabreeze 10 to 20 mph.
</when>
<when time="tonight">
Mostly clear except areas of low clouds and fog developing
overnight. Lows in the mid to upper 50s. Evening seabreeze
10 to 20 mph.
</when>
</text>
</weather>
Figure 13-2 shows a tree representing the structure of this data.
 
Search WWH ::




Custom Search