如要定義目前事件的基本資訊,請使用 <alert>
實體。
如果事件同時佔用多個持續性位置,建議將事件拆分為多個 alert
物件。舉例來說,如果森林火災跨越多個州,您可以將警報拆分為多個警報,每個州一個。這樣一來,您就能為每個狀態提供特定的緊急狀況資訊,並更準確地更新火災狀況。
如果事件快速變化,例如颶風從東向西移動,建議您定期更新警報。請勿從動態饋給中移除現有警報。請改為發出參照先前快訊的新快訊。
屬性
表 1 說明 <alert>
實體的屬性值:
表 1. <alert>
實體屬性
元素名稱 | 選填 | 類型 | 說明 |
---|---|---|---|
xmlns:cap |
必要 | string |
範例:
|
元素
表 2 說明 <alert>
實體的子元素值:
表 2. <alert>
實體元素
元素名稱 | 選填 | 類型 | CAP 和 Google 附註和規定 |
---|---|---|---|
<identifier> |
必要 | string |
提供代表事件的警示 ID。<identifier> 元素的值在所有事件中必須不重複。 |
<sender> |
必要 | string |
<sender> 元素會標示快訊的發送者。不得包含空格、逗號或受限制的字元。 |
<sent> |
必要 | dateTime |
如果 如果訊息內容適用於多個時區,請使用世界標準時間,而非當地時間。 |
<status> |
必要 | AlertStatus |
Google 只會發布 |
<msgType> |
必要 | AlertMsgType |
詳情請參閱「事件變更或到期」。 |
<source> |
選用 | string |
<source> 元素代表快訊的特定來源。例如作業員或特定裝置。 |
<scope> |
必要 | AlertScope |
|
<restriction> |
條件式 | string |
如果 <scope> 元素值為 Restricted ,則必須使用 <restriction> 元素。這個元素會說明限制限制性快訊訊息的發布規則。 |
<addresses> |
條件式 | string |
如果 <scope> 元素值為 Private ,則必須使用 <addresses> 元素。這個元素會列出快訊的指定收件者。您可以加入多個以空格分隔的地址,但包含空格的地址必須以雙引號括住。 |
<code> |
選用 | string |
|
<note> |
條件式 | string |
如果警示包含下列任一元素值,則必須使用
|
<references> |
條件式 | string |
如果 當系統重新發布其他發布者提供的 CAP 內容時,請納入完整的 CAP 警示。如要將編輯過的內容連結至原始來源,請使用 如果您要參照多則訊息,請使用空格做為分隔符。 |
<incidents> |
選用 | string |
<incidents> 元素會彙整多則訊息,這些訊息會提及同一事件的不同面向。 |
<info> |
必填欄位* |
info |
至少須提供一個 <info> 元素。多個 <info> 區塊都必須具有相同的 <category> 和 <event> 元素值。 |
* Google 要求元素具有粗體紅色 REQUIRED 選填性,但這些元素在 CAP 標準中為選填項目。
範例
<alert xmlns="urn:oasis:names:tc:emergency:cap:1.1">
<identifier>AL20110412020900TornadoWarning</identifier>
<sender>w-nws.webmaster@noaa.gov</sender>
<sent>2011-04-11T21:18:07-05:00</sent>
<status>Actual</status>
<msgType>Alert</msgType>
<scope>Public</scope>
<info>
<language>en-US</language>
<category>Met</category>
<event>Tornado Warning</event>
<urgency>Immediate</urgency>
<severity>Extreme</severity>
<certainty>Observed</certainty>
<effective>2011-04-11T21:09:00-05:00</effective>
<expires>2011-04-11T21:30:00-05:00</expires>
<headline>Tornado Warning issued April 11 at
9:30PM CDT by NWS Birmingham</headline>
<description>Tornado is observed near Cleburne.</description>
<instruction>
Don't wait to see or hear the tornado.
For your protection, move to an interior room on the lowest floor
of your home or business.</instruction>
<area>
<areaDesc>Cleburne</areaDesc>
<polygon>33.61,-85.58 33.65,-85.58 33.72,-85.58
33.81,-85.36 33.7,-85.34 33.7,-85.33 33.68,-85.33
33.61,-85.58</polygon>
</area>
</info>
</alert>