sf
Dictionary XML Specification. Abstract. This document presents… ← ArticlesSupportA free dictionary/glossary PHP-script Guest  •  Sign In  •  Register a new account

Article: #kb-16 Dictionary XML Specification. Abstract. This document presents…

  • Status: Published
  • Topic: General topic
  • Applies to: Glossword 1.8.11
  • Dictionary XML Specification

    Abstract

    This document presents a specification for an XML-file format to be used in Glossword dictionaries. The purpose of this format is to provide a simple method to describe dictionary data that is being exchanged among software tools.

    Status of this document

    This is a working draft document and may be updated, replaced, or obsoleted by other documents at any time. Comments may be sent to .

    Details

    Elements

    Structural Elements

    <glossword>

    Glossword dictionary - The <glossword> element encloses all the other elements of the document.

    Required attributes:
    None
    Optional attributes
    None
    Contents:
    <line>

    <line>

    One dictonary entry.

    Required attributes:
    None
    Optional attributes
    None
    Contents:
    One <term>, one or more <defn>.

    Inline Elements

    <term>

    Dictionary term.

    Required attributes:
    None
    Optional attributes
    None
    Contents:
    Text.

    <defn>

    Dictionary definition.

    Required attributes:
    None
    Optional attributes
    None
    Contents:
    Zero, one or more <abbr>, <trns>, <see>, <syn>, <src>, <xref> elements, Text.

    <abbr>

    Abbreviation. CSS-driven area, which always shows before a definition.

    Required attributes:
    None
    Optional attributes
    lang
    Contents:
    Plain Text.

    <trns>

    Translation variant. CSS-driven area, which always shows before a Definition and after <abbr>.

    Required attributes:
    None
    Optional attributes
    lang
    Contents:
    Plain Text.

    <see>

    One term that is related to the current term.

    Required attributes:
    None
    Optional attributes
    link
    Contents:
    Plain Text.

    <syn>

    One synonym term for the current term.

    Required attributes:
    None
    Optional attributes
    link
    Contents:
    Plain Text.

    <src>

    The source of information for definition. Can be a name, HTML-code, E-mail address, etc.

    Required attributes:
    None
    Optional attributes
    None
    Contents:
    Text.

    <xref>

    Link to another term, works within the current dictionary.

    Required attributes:
    link
    Optional attributes
    None
    Contents:
    Plain Text.

    <usg>

    Example phrase for a term usage. Zero, one or more.

    Required attributes:
    None
    Optional attributes
    None
    Contents:
    Plain Text.
    xml
    1. <line>
    2.   <term><![CDATA[block]]><term>
    3.   <defn>
    4.     <abbr lang="v.tr."><![CDATA[block on]]></abbr>
    5.     <![CDATA[<p>To block, waiting for (something).</p>]]>
    6.     <usg><![CDATA[Lunch is blocked on Phil's arrival.]]></usg>
    7.   </defn>
    8. </line>

    <trsp>

    Phonetic transcription, the rule to pronounce. CSS-driven area with extended Unicode font, such as Arial Unicode MS, Lucida Sans Unicode. Appears before <trns> and <abbr>. Zero, one or more.

    Required attributes:
    None
    Optional attributes
    None
    Contents:
    Plain Text.
    xml
    1. <line>
    2.   <term><![CDATA[Assembler Language]]><term>
    3.   <defn>
    4.     <trsp><![CDATA[ə'sɛmblə 'læŋgwɪʤ]]></trsp>
    5.     <![CDATA[<p>The lowest level programming language, where programmer sets direct instructions for processor in human readable format.</p>]]>
    6.     <see link="Assembler"><![CDATA[Assembler]]></see>
    7.   </defn>
    8. </line>

    <stress>

    Accent, emphasis. Makes a word accented.

    Required attributes:
    None
    Optional attributes
    None
    Contents:
    Plain Text.
    xml
    1. t<stress>e</stress>l<stress>e</stress>fone
    2. <stress>a</stress>ny <stress>w</stress><stress>o</stress><stress>r</stress><stress>d</stress>

    rendered as:

    1. téléfone
    2. ány ẃóŕd́

    Attributes

    Optional and required attributes

    lang

    Attribute for an additional purpose. Language name, for example. Optional.

    Value description:
    Conditional name for language, abbreviation or anything else, that can be used to mark out a text. Examples:
    xml
    1. <abbr lang="v.tr."><![CDATA[to beat]]></abbr>
    2. <abbr lang="playing time"><![CDATA[00:32:01]]></abbr>
    3. <trns lang="Sw."><![CDATA[fabriker]]></trns>

    renders as:

    v.tr. to beat

    playing time 00:32:01

    Sw. fabriker

    Used in:
    <abbr>, <trns>

    link

    A hyper link. Optional.

    Value description:
    Common reference in the dictionary.
    xml
    1. <line>
    2.   <term><![CDATA[NTSC Format]]><term>
    3.   <defn>
    4.     <![CDATA[A color television format having 525 scan lines (rows) of resolution at thirty frames per second (30 Hz). Found in American and Japanese DVD, VHS video, television and video games. 29.97 fps.]]>
    5.     <see link="NTSC"><![CDATA[NTSC]]></see>
    6.     <see link="PAL format"><![CDATA[PAL format]]></see>
    7.     <see><![CDATA[<a href="http://">external link</a>]]></see>
    8.   </defn>
    9. </line>
    xml
    1. <defn>
    2. ...which produces extensions like
    3. <xref link="tar.gz">.tar.gz</xref>,
    4. <xref link="tar.Z">.tar.z</xref>, and
    5. <xref link="tgz">.tgz</xref>.
    6. </defn>
    Used in:
    <see>, <syn>, <xref>

    t1, t2, t3

    Alphabetic order. Optional.

    Value description:
    Attribute value used to construct alphabetic order.
    xml
    1. <term t1="E" t2="X" t3="A"><![CDATA[Example]]></term>

    Constructs navigation as follows:

    E → EX → EXA → Example

    Used in:
    <term>

    uri

    Uniform Resource Identifier (URI). Optional.

    Value description:
    Attribute value used to construct links to term when SEO-mode is enabled.
    Used in:
    <term>

    id

    Term ID. Optional.

    Value description:
    Primary used for import. If a term with the same Term ID exists, it will be overwritten.
    Used in:
    <term>

    Sample documents

    Inuit-English dictionary

    xml
    1. <line>
    2.   <term><![CDATA[pingasuyortok]]></term>
    3.   <defn><![CDATA[]]>
    4.     <abbr lang="Okk."><![CDATA[]]></abbr>
    5.     <trns><![CDATA[six]]></trns>
    6.   </defn>
    7. </line>

    Example dictionary

    xml
    1. <line>
    2.   <term t1="X" t2="M" t3="L" uri="xml-declaration" id="21"><![CDATA[XML declaration]]></term>
    3.   <defn><![CDATA[Part of an XML document that defines the version of XML being used. Although the XML declaration looks like a processing instruction, it is not. For that reason, you cannot access the XML declaration from an XSLT stylesheet or an XPath expression.]]></defn>
    4. </line>
    5. <line>
    6.   <term t1="S" t2="O" t3="U" uri="southing" id="23"><![CDATA[southing]]></term>
    7.   <defn><![CDATA[]]>
    8.     <abbr lang="048"><![CDATA[]]></abbr>
    9.     <![CDATA[a southern movement.]]>
    10.   </defn>
    11.   <defn><![CDATA[]]>
    12.     <abbr lang="144"><![CDATA[]]></abbr>
    13.     <![CDATA[the distance travelled or measured southward.]]></defn>
    14.   <defn><![CDATA[]]>
    15.     <abbr lang="062"><![CDATA[]]></abbr>
    16.     <![CDATA[the angular distance of a star etc. south of the celestial equator.]]>
    17.   </defn>
    18. </line>

    $Id: spec_xml.html,v 1.1.1.5 2003/05/08 04:23:00 tty Exp $

  • Created: , DmitrySh
  • Modified:

New comment

Discussion closed.