Lesson 4: Features of a CAP Message
* required lesson
Попытка: 43
XML: A Digital Document Format
CAP alert messages are created and disseminated using XML (eXtensible Markup Language). XML is designed to store and transport information via the internet. Here's a simple example of an XML message:
<?xml version="1.0" encoding="UTF-8"?>
<note>
<to>John</to>
<from>Jane</from>
<heading>Weather Report</heading>
<body>This weekend's forecast is for clear and sunny skies.</body>
<importance>Not important</importance>
</note>
The message is made up of a series of elements each of which contains information described by its <tag>. In this example, the elements make up the contents of a note sent from Jane to John in regards to the weather and it is marked as not being important.
By itself, this XML message does not do anything - it just contains information; information that is readable by humans but also by software. If the author of the message sets a standard for what each of the elements contains, then receivers of the message can consistently parse the information and put it to use. For this simple example, a programmer could write an application to display the message as an email or a text message. They could use the <importance> information to color code the message or to trigger a notification on the receiver's phone.
That is the basics of what an XML message is and how it can be put to use. Continue to Eliot's presentation to see how XML is used in CAP messages.