Skip to content
Hub Nexus

No author yetClaim it

Version 1Updated 2 min read

Support

Motivation

You want to associate a synonym set with a single business term. A synonym set is a group of terms that have similar meaning or similar semantics. They are grouped together in a structure called a synonyms set. A term can be associated with one-and-only-one synonym set.

These tools are frequently used during the process of creating an enterprise-wide controlled vocabulary. These vocabularies are used for identifying data elements or expressing business rules in a consistent way across multiple organizations.

Method

In this program we will have once instance that has an initial synonym set. We will have a button that reveals alternative synonyms using a switch/case. When you select a new synonym set it will copy the selected synonym set tree into the selected synonym set and close the case.

Sample Program Code

xmlns="http://www.w3.org/1999/xhtml"
xmlns:xf="http://www.w3.org/2002/xforms"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ev="http://www.w3.org/2001/xml-events" >

Test of XForm to Associate Synonym Set to Business Term
type="text/css">
@namespace xf url("http://www.w3.org/2002/xforms");
body {font-family:Helvetica, sans-serif}
.preferred {font-weight:bold;}
.synonym xf|repeat * {display:inline}
.url {color: blue; text-decoration:underline; margin: 0 2px;}
.syn-list {background-color: sliver;}

xmlns="" id="current-synset">

2

false
Middle Item

false
Central Item

true
Second Item

false
Following Item

false
After First Item

false
Following Item

xmlns="" id="synonym-sets">

1

false
Origin Item

false
First Item

true
Initial Item

false
Stat Item

false
Begin Item

false
Originating Item

2

false
Middle Item

false
Central Item

true
Second Item

false
Following Item

false
After First Item

false
Following Item

3

false
Final Item

false
Ending Item

true
Last Item

false
End Item

false
Tail Item

xmlns="" id="URL-container">

Test of XForm to Associate Synonym Set to Term
class="synonym">
class="group-label">Synonyms for This Term:
nodeset="instance('current-synset')/synonym" id="synonym-repeat">
appearance="minimal" class="url">

ref=".[preferred='true']">
ref="syn-name" class="preferred"/>

ref=".[preferred='false']">
ref="syn-name"/>

ref="syn-name"/>

ev:event="DOMActivate">
ref="instance('URL-container')" value="concat('http://www.example.com/view-term.xq?name=', instance('current-synset')/synonym[index('synonym-repeat')=position()]/syn-name)"/>
ref="instance('URL-container')"/>

id="init">

Change Synonym Set
case="list-synsets" ev:event="DOMActivate"/>

id="list-synsets">
Set New Synonym Set:
nodeset="instance('synonym-sets')/SynSet" id="set-repeat">

Set
ev:event="DOMActivate">
nodeset="instance('current-synset')"
origin="instance('synonym-sets')/SynSet[index('set-repeat')]" />
case="init" />

nodeset="synonym">
appearance="minimal" class="url">

ref=".[preferred='true']">
ref="syn-name" class="preferred"/>

ref=".[preferred='false']">
ref="syn-name"/>

ev:event="DOMActivate">
ref="instance('URL-container')"
value="concat('http://www.example.com/view-term.xq?name=', instance('current-synset')/synonym[index('synonym-repeat')=position()]/syn-name)"/>
ref="instance('URL-container')"/>

Close Synonym Sets List
case="init" ev:event="DOMActivate"/>

Where this page came from

This page was imported from Wikibooks. From “XForms” on Wikibooks, by its contributors, under CC BY-SA 4.0. Changed here: set as a page; navigation and edit links left out; each image under its own licence, credited in its caption.

Nobody has written it yet — it is the source material at a new address, which is why search engines are asked to skip it and why no one earns from it. It is up for grabs: take it on, and it is yours to rewrite and to earn from.

Get each new page of

XForms

Following means one email when a page is added, nothing when a page changes.

Following means one email when a page is added, nothing when a page changes.

Comments

Spinner Logo

Next in XForms

CC BY-SA 4.0
At the end the line items are totaled and an indication made to see if the invoice was paid or not. 123 2008-10-10 Acme Services 123 Main St. Anytown, MN 12345 Acme Consumer 123 Main St. Anytown, MN 12345 Widget 123 100.00 Widget 456 200.00 Widget 789 300.00 net-30 false ## XForms User Interface The
CC BY-SA 4.0
One of the classic examples of a web application program is a calculator. ## Program <html xmlns=" xmlns:xf=" xmlns:ev=" <head> <title>Calculator Sample</title> <xf:model> <xf:instance> <equation xmlns=""> <display>0</display> <displaybuffer>0</displaybuffer> <first>0</first> <second>0</second> <mem
CC BY-SA 4.0
id="xforms_cntrl_source_presumed"> appearance="full" ref="instance('taskoutput')/ fe:source_presumed"> undefined undefined_value id="xforms_cntrl_source_information"> appearance="full" ref="instance('taskoutput')/ fe:source_information"> undefined undefined_value id="xforms_cntrl_defendant_reputatio
CC BY-SA 4.0
This is an example of using CSS to format a table without actually using the HTML table element. This is critical since some browsers do not support dynamic tabular layout. The Firefox 0.6 extension also does not support the repeat-nodeset attribute, so you can not yet display repeating data inside
CC BY-SA 4.0
This control displays a different image when a select1 list is selected. ## Screen Image ![XForms-custom-control]( (Image: The original uploader was Dmccreary at English Wikibooks ., CC BY-SA 3.0) ## Sample Program <html xmlns=" xmlns:xf=" <head> <title>Custom Image Control Sample</title> <bindings
CC BY-SA 4.0
function dirty() { setBunload(true); } function clean() { setBunload(false); } This one goes in your "submission" element: resource="javascript:clean()" ev:event="xforms-submit-done"/> and this resource="javascript:dirty()" ev:event="xforms-value-changed"/> goes somewhere in the form - place it at t