¿Ves algo que mejorar? Propón un cambio.
En XForms · página 120 de 137
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.
En estas publicacionesXForms
Licencia: CC BY-SA 4.0 · Adaptado de en.wikibooks.org
1
0
0
0

Comentarios






