From the course: Learn API Documentation with JSON and XML

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

XML solution

XML solution

From the course: Learn API Documentation with JSON and XML

Start my 1-month free trial

XML solution

- [Voiceover] Now let's take a look at the solutions to the trait XML exercises. This is the XML for the first part, which shows you the forecast for one day. The very first line just shows you that this is an XML file right here. And then after that you have a daily forecast tag. This is the start tag and it's matched up with the end tag down here. And then each of these is a tag, for example, date and description and so on. For things like the maximum temperature, I added an attribute, a unit equals C to tell you that it's celsius and then for wind speed I've got a unit equals KPH for kilometers per hour. But that's pretty much all there is to it. All right, let's move onto the one for multiple day. Multiple day is very similar. Again, you have a line saying that it's XML. But now we have a forecast tag right here. And this is going to contain the daily forecast tags. So we have a start tag up here and we have an end tag down here. Within it, we have the daily forecast tag, which is…

Contents