Section 1: Motivation
Section 1: Motivation
Section 1: Motivation
Section 1: Motivation
Section 1: Motivation
Name-value pairs:
Name | Value/Definition |
NARA | National Archives and Records Administration |
USPTO | United States Patent and Trademark Office |
NOAA | National Oceanic and Atmospheric Administration |
... | ... |
Section 1: Motivation
This table can be considered a complex code list because it contains values for the same information Container Name.
Container Code | Description | Depth | Width | Height | TotalCubicFoot |
ACF-S | Archival Quality Cubic Foot Container, Standard | 16.500 | 12.500 | 10.750 | 2217.188 |
AER-A | Aerial Film Can, Standard | 5.500 | 5.500 | 10.000 | 302.500 |
AER-B | Aerial Film Can, 500 | 7.250 | 7.250 | 9.500 | 499.3438 |
Section 1: Motivation
Section 1: Motivation
Section 1: Motivation
Section 1: Motivation
Section 1: Motivation
Section 1: Motivation
<html> <body> <form action="createTR.php" method="post"> Transfer Request ID: <input type="text" name="tr-id" /> Agency: <input type="text" name="agency" /> <input type="submit" /> </form> </body> </html>
<form action="createTR.jsp" method="post">
<form action="createTR.asp" method="post">
Section 1: Motivation
Section 1: Motivation
Section 1: Motivation
Use xsd:enumeration
Use relational database
Section 1: Motivation
Section 2: Brief Introduction to XForms
Section 2: Brief Introduction to XForms
Section 2: Brief Introduction to XForms
Very similar to HTML forms but with more functionality.
XForms Control |
Definition | Example |
<xforms:input> | Free form text. | Link to Example |
<xforms:secret> | Used to capture data while being hidden. Can be used to capture password information. | Link to Example |
<xforms:textarea> | Free formed block of text in a multiline format. | Link to Example |
<xforms:output> | Display information to the user. | Link to Example |
<xforms:upload> | Provides the ability for a user to upload an external file. | Link to Example |
<xforms:range> | Provides the ability for a person to upload a value from a range of values. | Link to Example |
<xforms:trigger> | Provides a user triggered action | Link to Example |
<xforms:select> | Provides the ability to allow the user to select multiple values from a list. | Link to Example |
<xforms:select1> | Provides the ability to allow the user to select a single value from a list. | Link to Example |
<xforms:submit> | Provides the ability submit data to a processor. Works in conjunction with the <xforms:submission> element. | Link to Example |
Section 3: Genericode Introduction
Section 4: Genericode and XForms
Three major sections:
Section 4: Genericode and XForms
<CodeList xmlns="http://docs.oasis-open.org/codelist/ns/genericode/1.0/" xmlns:era="http://archives.gov/era/schema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://docs.oasis-open.org/codelist/ns/genericode/1.0/ ile:/G:/Projects/standards/Genericode/genericode.xsd"> <Identification xmlns=""> <LongName xml:lang="en">Holdings_Measurements</LongName> <Version>1</Version> <Agency> <LongName xml:lang="en">US National Archives Records Administration</LongName> <Identifier>1</Identifier> </Agency> </Identification> <ColumnSet xmlns=""> <Column Id="ContainerCode" Use="required"> <ShortName>Container Code</ShortName> <Data Type="xsd:normalizedString" xml:lang="en"/> </Column> <Column Id="ContainerDescription" Use="Required"> <ShortName>Container Description</ShortName> <Data Type="xsd:string" xml:lang="en"/> </Column> <Column Id="Depth" Use="Optional"> <ShortName>Depth</ShortName> <Data Type="xsd:integer" xml:lang="en"/> </Column> <Column Id="Width" Use="Optional"> <ShortName>Width</ShortName> <Data Type="xsd:integer" xml:lang="en"/> </Column> <Column Id="Height" Use="Optional"> <ShortName>Height</ShortName> <Data Type="xsd:integer" xml:lang="en"/> </Column> <Column Id="TotalCubicFoot" Use="Optional"> <ShortName>Total Cubic Footage</ShortName> <Data Type="xsd:integer" xml:lang="en"/> </Column> </ColumnSet> <SimpleCodeList xmlns=""> <Row> <Value ColumnRef="ContainerCode"> <SimpleValue>ACF-S</SimpleValue> </Value> <Value ColumnRef="ContainerDescription"> <SimpleValue>Archival Quality Cubic Foot Container, Standard</SimpleValue> </Value> <Value ColumnRef="Depth"> <SimpleValue>16.500</SimpleValue> </Value> <Value ColumnRef="Width"> <SimpleValue>12.500</SimpleValue> </Value> <Value ColumnRef="Height"> <SimpleValue>10.750</SimpleValue> </Value> <Value ColumnRef="TotalCubicFoot"> <SimpleValue>2217.188</SimpleValue> </Value> </Row> <Row> <Value ColumnRef="ContainerCode"> <SimpleValue>AER-A</SimpleValue> </Value> <Value ColumnRef="ContainerDescription"> <SimpleValue>Aerial Film Can, Standard</SimpleValue> </Value> <Value ColumnRef="Depth"> <SimpleValue>5.500</SimpleValue> </Value> <Value ColumnRef="Width"> <SimpleValue>5.500</SimpleValue> </Value> <Value ColumnRef="Height"> <SimpleValue>10.000</SimpleValue> </Value> <Value ColumnRef="TotalCubicFoot"> <SimpleValue>302.500</SimpleValue> </Value> </Row> <Row> <Value ColumnRef="ContainerCode"> <SimpleValue>AER-B</SimpleValue> </Value> <Value ColumnRef="ContainerDescription"> <SimpleValue>Aerial Film Can, 500</SimpleValue> </Value> <Value ColumnRef="Depth"> <SimpleValue>7.250</SimpleValue> </Value> <Value ColumnRef="Width"> <SimpleValue>7.250</SimpleValue> </Value> <Value ColumnRef="Height"> <SimpleValue>9.500</SimpleValue> </Value> <Value ColumnRef="TotalCubicFoot"> <SimpleValue>499.343</SimpleValue> </Value> </Row> ... </SimpleCodeList> </CodeList>
Section 4: Genericode and XForms
What is XML fat?
Section 4: Genericode and XForms
In many cases the fat content of the genericode is not a concern. However when organizations have multiple codelists and hundreds of codes for a single code list cutting the fat is essential for streamlined forms.
Section 4: Genericode and XForms
Section 4: Genericode and XForms
<FormCodeList codeListName="Holdings_Measurements" version="1"> <Row> <ContainerCode>ACF-S</ContainerCode> <ContainerDescription>Archival Quality Cubic Foot Container, Standard</ContainerDescription> <Depth>16.500</Depth> <Width>12.500</Width> <Height>10.750</Height> <TotalCubicFoot>10.750</TotalCubicFoot> </Row> <Row> <ContainerCode>AER-A</ContainerCode> <ContainerDescription>Aerial Film Can, Standard</ContainerDescription> <Depth>5.500</Depth> <Width>5.500</Width> <Height>10.000</Height> <TotalCubicFoot>10.000</TotalCubicFoot> </Row> <Row> <ContainerCode>AER-B</ContainerCode> <ContainerDescription>Aerial Film Can, 500</ContainerDescription> <Depth>7.250</Depth> <Width>7.250</Width> <Height>9.500</Height> <TotalCubicFoot>9.500</TotalCubicFoot> </Row> ... </FormCodeList>
Section 4: Genericode and XForms
Section 4: Genericode and XForms
The two examples below are both fully-qualified URL's. The first example points to the eXist XML repository that contains the codelists. The second example points to a fully qualified URL.
In the example below the <xforms:instance> element points to the filesystem. The directory root is the directory where the XForms is located.
<xforms:instance id="Container-instance" src="http://localhost:8080/exist/rest/db/home/era/CodeLists/ContainerFormCodeList.xml"/> <xforms:instance id="Container-instance" src="http://www.myurl.com/codelists/ContainerFormCodeList.xml"/>
Section 4: Genericode and XForms
A code list can reside on the file system. The XForms engine will require access to the file system.
<xforms:instance id="AccessRestriction-instance" src="CodeLists/ContainerFormCodeList.xml"/>
Section 4: Genericode and XForms
<xforms:select1 ref="era:ContainerType"> <xforms:item> <xforms:label>Choose One...</xforms:label> <xforms:value/> </xforms:item> <xforms:itemset nodeset="instance('Container-instance')/Row/ContainerDescription"> <xforms:label ref="."/> <xforms:value ref="."/> </xforms:itemset> </xforms:select1>
NOTE: Only 1 value can be saves.
Section 4: Genericode and XForms
If you have repeating values, you should use <xforms:repeat> to wrap each code into XML.
<xforms:repeat nodeset="era:ContainerInformation/era:Container" id="repeatContainer"> <xforms:select1 ref="era:ContainerType"> <xforms:item> <xforms:label>Choose One...</xforms:label> <xforms:value/> </xforms:item> <xforms:itemset nodeset="instance('Container-instance')/Row/ContainerDescription"> <xforms:label ref="."/> <xforms:value ref="."/> </xforms:itemset> </xforms:select1> </xforms:repeat> <xforms:trigger> <xforms:label>Repeat Container</xforms:label> <xforms:insert nodeset="Paper" at="index('repeatContainer')" position="after" ev:event="DOMActivate" /> </xforms:trigger>
Section 4: Genericode and XForms
The <xforms:bind> element is uses to bind values from the codelist instance to the resulting XML document.
From the code <ContainerCode> we want to populate three values. We will need 1 <xforms:variable> and three <xforms:bind> elements.
<?xml version="1.0" encoding="UTF-8"?> <FormCodeList codeListName="Holdings_Measurements" version="1"> <Row> <ContainerCode>ACF-S</ContainerCode> <ContainerDescription>Archival Quality Cubic Foot Container, Standard</ContainerDescription> <Depth>16.500</Depth> <Width>12.500</Width> <Height>10.750</Height> <TotalCubicFoot>10.750</TotalCubicFoot> </Row> . . . </FormCodeList>
Section 4: Genericode and XForms
The <xforms:variable> element is used to provide the capability to compare the instance value (form) against the codelist value. The codelist can reside in the database or on the filesystem.
<xforms:variable name="containerType" select="era:ContainerInformation/era:Container/era:ContainerType"/> <xforms:setvalue ref="era:ContainerDimensions/era:Height" ev:event="DOMActivate"/>
Section 4: Genericode and XForms
The <xforms:bind> element must be used for every value in the codelist that gets set.
<xforms:bind nodeset="descendant::era:Height" id="bindHeight" calculate="instance('Container-instance')/Row[ContainerDescription = $containerType]/Height"/> <xforms:bind nodeset="descendant::era:Width" id="bindWidth" calculate="instance('Container-instance')/Row[ContainerDescription = $containerType]/Width"/> . . .
Section 4: Genericode and XForms
Demo of XForms-Genericode http://www.eccnet.com:8010/XForms/TransferRequestRedesign
Section 4: Genericode and XForms
Thank You Very Much!
The End