How to Read Reference

1. Structure of Reference

This chapter provides an explanation about reference topics according to actual development task using XVCD. The chapter also provides a useful reference for each stage of development task. The following topics are covered:

1.1. Displaying and Editing an XML Document

In XVCD file, you should describe the conversion rule from XML data structure such as example 1 (source XML document) to the result data structure such as example 2 (destination XML document). That is, codes described in XVCD file are a set of rules as conversion stationery (template rule).

[Example 1] XML Data Structure (Source XML Document)

<?xml version="1.0"?>
<hw:document xmlns:hw="http://xmlns.xfytec.com/samples/helloworld">
   <hw:message>
      Hello World!
   </hw:message> 
</hw:document>

[Example 2] Result Data Structure (Destination XML Document)

<?xml version="1.0"?>
<xhtml:html
   xmlns:xhtml="http://www.w3.org/1999/xhtml"
   xmlns:hw="http://xmlns.xfytec.com/samples/helloworld"
   >
   <xhtml:body>
      <xhtml:p>
         Hello World!
      </xhtml:p>
   </xhtml:body>
</xhtml:html>

In vocabulary component development by XVCD, a template rule is created in two steps:

  1. Describe an object of applying a template rule
    Describes the object to which a template rule is applied.
  2. Describe conversion result by a template rule
    Describes how to output data from the object to which a template rule is applied.

Edit features corresponding to XML vocabulary can be implemented by describing elements and functions relevant to XVCD edits in a template rule.

Describing a template rule in XVCD allows you not only to display XML document, but leverage the following:

  • Shows XML document in tabular format.
  • Divides a window into parts and show different contents in each.
  • Switches XML documents and user interfaces using tab sheet.

References relevant to displaying and editing an XML document are as follows:

  • VC Core
    Describes the template rule such as vertex elements, template elements as a foundational element for XVCD. Also provides an explanation about XVCD elements and functions relevant to editing an XML document.
  • Table Description
    Using table description for destination XML document generated by XVCD allows you to show an XML document in tabular format. The table description section provides instructions on how to show an XML document in tabular format.
  • Frame Descriptions
    Using frame description for destination XML document generated by XVCD allows you to divide a window into parts and show XML documents. The frame description section provides instructions on how to divide a window into frames and display an XML document in each frame.
  • Tab Sheet Description
    Using tab sheet description for destination XML document generated by XVCD allows you to switch XML documents and user interfaces using tab sheet. The tab sheet description section provides instructions on how to create tab sheet and how to display XML documents in tab sheet.
  • XHTML Support Status
    Using XHTML for destination XML document generated by XVCD allows you to show an XML document using expressive possibilities of XHTML. Explains XHTML support status by xfy technology user agent.
  • CSS Support Status
    xfy technology user agent allows you to layout destination XML document using CSS. Explains CSS support status by xfy technology user agent.

1.2. XML Data Structure Operation

You may edit an XML document using key, mouse and menu bar. Depending on XML document edit operation, you may need to operate XML data structure such as appending a new element to source XML document or deleting an element.

Key or mouse operation by user can be recognized as an event. xfy technology provides events corresponding to fundamental user operations beforehand.

You can customize user interface by appending menu items created by vocabulary components to the menu bar and tool bar.

Commands are executed by operating key, mouse or menu bar, etc. Based on user operation, XML data structure is operated by command. There exist two types of commands: built-in commands supplied by xfy technology and commands created by vocabulary component.

To use a built-in command, assign the command to an event or user interface.

To create a command by vocabulary component, describe command operations (command instruction) and control statements (conditional branch, etc) in the command elements (xvcd:command element). You can assign the created command to an event or user interface.

To assign a command to an event, use action element (xvcd:action element). To assign a command to a user interface, use user interface description. Assigning a command to an event and user interface allows you to execute the command.

References relevant to operating XML data structure are as follows:

  • VC Core
    Explains command element (xvcd:command element) and action element (xvcd:action element), command instructions and functions for editing XML document.
  • Platform Commands
    Explains built-in commands supplied by xfy technology. Built-in commands available in XVCD may be grouped below:
    • File Operation
    • View
    • Edit
    • Bookmark Operation
    • Tools
    • Other
  • Platform Command Instruction
    Explains command instructions for describing command operation. Also explains XVCD elements for achieving control statement.
  • Platform Events
    Explains events supplied by xfy technology.
  • User Interface Descriptions
    Explains how to customize user interfaces such as menu bar and tool bar and how to assign commands to user interfaces.

1.3. Adding Auxiliary Functions to Vocabulary Component

Depending upon XML vocabularies handled by vocabulary component, you may need the following advanced display and edit functions:

  • Automatically update date
  • Calculate using square root, trigonometric function.

Auxiliary functions provided by xfy technology allow you to easily support advanced display and edit functions. In xfy technology, calculation script, data conversion and platform extend functions are provided as auxiliary functions.

References relevant to auxiliary function of vocabulary component are as follows:

  • Calculation Script
    Explains the overview of calculation script in XML document and its elements.
  • Data Conversion
    Explains elements used for data conversion in drag & drop, copy & paste, their operating conditions, and complementations performed during data conversion.
  • Platform Extend Functions
    Explains xfy technology-specific XPath functions. Platform extend functions may be grouped below:
    • Input/Output Functions
    • Number Functions
    • Statistics Functions
    • Date Functions
    • String Manipulation Functions
    • Logical Functions
    • Tool Functions

1.4. Saving and Creating New XML document

You may describe a formatting rule in XVCD in order to format XML document. This formatting rule is called XFR (XML Formatting Rule). In XFR, you can specify formatting for each element used in XML document and format a source view of an XML document. Available formattings are as follows:

  • Element alignment
  • Whitespace's handling within element
  • Indent position

You can use document template when creating new XML document in xfy technology user agent. To create a document template, use document template element (xvcd:document-template element). Currently processed XVCD is applied to template rules described in document template elements and a document template is created.

Existing XML file is available as a new XML document. For information about creating a new XML document, refer to "New XML Document Creation Scheme Reference".

References relevant to saving and creating new XML document are as follows:

  • XFR (XML Formatting Rule)
    Provides an overview of XFR, a discussion of its usage, and its elements and attributes.
  • VC Core
    Explains document template creation applied by currently processed XVCD. Refer to document template element (xvcd:document-template element).
  • New XML Document Creation Scheme
    Explains how to use existing XML file as a new XML document, and how to create a new XML document from document template elements (xvcd:document-template element) of XVCD file.

1.5. Support for Efficiently Creating Vocabulary Component

When creating vocabulary component in XVCD, in order to develop efficiently, you can describe component information and commonly used strings, etc. in another file and refer the file from XVCD file. A resource file is provided for this purpose.

In a manifest file, describe necessary information to register and update the vocabulary component.

  • Vendor name
  • Version of Vocabulary Component

Creating a manifest file makes it easy to manage vocabulary components.

Using xvcd:import element allows you to describe a part of complicated XVCDs in another file. Describing a part of XVCDs in another file and sharing the file allows you to save the trouble of describing the same process and makes codes easy to read.

For example, you can create XVCD files to display table, list and sentence respectively, or create XVCD files for each division or chapter, and combine them as needed.

References relevant to support for creation of vocabulary component are as follows:

  • resource file
    Explains elements required to create a resource file.
  • Manifest File
    Explains information required to create a manifest file.
  • VC Core
    Explains how to import XVCD described in another file. Refer to xvcd:import element.

2. Reference Notation

Explains the structures and conventions used in each reference:

2.1. Namespace Prefix

The namespace prefix used in the description is identified at the top of each reference.

2.2. Data Type

The conventions used in descriptions, unless clearly noted, comply with the following data type conventions:

  • Value of an element and attribute value
    W3C recommendation on XSLT, or the data type used in W3C recommendation on XSLT Schema
  • Argument and return value of function
    Data type used in W3C recommendation on XPath
About qualified name (QName)

The following object names described in XVCD are specified with qualified name (QName).

  • Vocabulary
  • Template with name
  • Mode
  • Variable or parameter
  • Key
  • Attribute set
  • User data
  • Property
  • Commands
  • Simple data type
  • Decimal format

If these names include a namespace prefix, XVCD uses the namespace defined in the context to expand the namespace prefix to a namespace URI. If a namespace prefix is not included, XVCD uses a qualified name for which the namespace URI reference is null. In this case, the default namespace is not used.

Encoded URL

As seen here and there, characters essentially unavailable for URL may be used in URL notations. For example, following URL notation are, strictly speaking, not correct according to URL definition.

  • file:///C:/WINDOWS/(Katakana...).bmp (contains katakana)
  • file:///C:/Documents and Settings/ (contains single-byte whitespace)
  • http://www.xfytec.com/%2%20 (encoding notation of characters is incorrect)

In xfy technology, regular URL notation that is used to appropriately encode characters unavailable for URL is called encoded URL.

In xfy technology, a URL that contains characters other than those below is not considered to be an encoded URL.

  • Single-byte alphabet (both uppercase and lowercase)
  • Single-byte numerals, symbols enumerated below:
    #/;?:@&=+$,-._!~*'()%[]

Strict definition of URL may vary according to its schema. For details, refer to RFC in which each schema was defined.

When encoded URL is required in XVCD, use function:url-encode() function to generate an encoded URL. And, function:url-decode() function to convert from encoded URL to readable format is also provided.