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:
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:
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:
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:
References relevant to displaying and editing an XML document are as follows:
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:
xvcd:command element) and action element (xvcd:action element), command instructions and functions for editing XML document.
Depending upon XML vocabularies handled by vocabulary component, you may need the following advanced display and edit functions:
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:
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:
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:
xvcd:document-template element).
xvcd:document-template element) of XVCD file.
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.
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:
xvcd:import element.
Explains the structures and conventions used in each reference:
The namespace prefix used in the description is identified at the top of each reference.
The conventions used in descriptions, unless clearly noted, comply with the following data type conventions:
The following object names described in XVCD are specified with qualified name (QName).
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.
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.
(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.
#/;?:@&=+$,-._!~*'()%[]
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.