XRX/NIEM Services

From Wikibooks, open books for an open world
Jump to navigation Jump to search

Motivation[edit | edit source]

You want to create a set of web services based on the National Information Exchange Model.

Process[edit | edit source]

We will import the core NIEM data as an XML Schema.

To do this first download the NIEM data model from the NIEM.gov web site. Inside the zip file you will find a niem-core directory with a niem-core.xsd file. Add this to your database and run the following XQuery on it:

Sample Code[edit | edit source]

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'

      for $type in doc($doc)//xs:complexType
          <type>{substring-before(data($type/@name), 'Type')}</type>

This will return a list of all the NIEM complex types.


This XQuery can in turn be used as a web service to populate an XForms suggestion list similar to the Suggestion example in the XForms cookbook.

Back: Table SortingNext: Product Ratings