XRX/NIEM 服務
外觀
< XRX
您想要基於國家資訊交換模型建立一個 Web 服務集。
我們將匯入核心 NIEM 資料作為 XML 模式。
為此,首先從 NIEM.gov 網站下載 NIEM 資料模型。在 zip 檔案中,您將找到一個包含 niem-core.xsd 檔案的 niem-core 目錄。將其新增到您的資料庫中,並在其上執行以下 XQuery
declare namespace xs="http://www.w3.org/2001/XMLSchema";
declare option exist:serialize "method=xml media-type=text/xml indent=yes";
let $doc := '/db/niem/data/niem-core.xsd'
return
<results>{
for $type in doc($doc)//xs:complexType
return
<type>{substring-before(data($type/@name), 'Type')}</type>
}</results>
這將返回所有 NIEM 複雜型別的列表。
<results>
<type>ActivityConveyanceAssociation</type>
<type>ActivityDocumentAssociation</type>
<type>ActivityInvolvedPersonAssociation</type>
<type>ActivityItemAssociation</type>
<type>ActivityOrganizationAssociation</type>
<type>ActivityPersonAssociation</type>
<type>ActivityScheduleAssociation</type>
<type>Activity</type>
<type>AddressGrid</type>
...
這個 XQuery 可以反過來用作 Web 服務來填充與 XForms 食譜中的建議示例類似的 XForms 建議列表。