VC Core Reference

This chapter provides a discussion about an overview of the namespace for the VC Core, and its elements and attributes.

1. Overview

Provides an overview of the VC core namespace.

1.1. Features and Usage

The namespace for describing various core features of VC, such as converting XML documents, responding to user operations (or actions), and providing command instructions for editing documents. You write your XVCD using mainly this namespace in conjunction with those for other common features. The elements defined in VC core namespace may be classified into the following features:

  • Vocabulary association, conversion
  • Assignment of response to user operation
  • Command Instruction for Editing an XML Document
  • Defining a Command
  • Variable management to use during XML document editing

1.2. Namespace URI Reference

The namespace URI reference for VC Core is http://xmlns.xfytec.com/xvcd. In the descriptions below, we use the namespace prefix xvcd: for an element used in VC Core.

Also, we use the following namespaces and their prefixes in the descriptions below.

We also use the namespace prefix xsl: for an element used in XSLT. If an element which belongs to a namespace other than these namespaces is described, specify the namespace prefix explicitly at the namespace's first appearance. The attribute is, unless explicitly specified, defined in the same namespace as the element which uses the attribute.

2. Elements, Attributes, and Functions Defined within the VC Core's Namespace

For each feature, provides a discussion of elements, attributes, and functions defined in VC core namespace.

2.1. Root Element

VC core namespace's root elements is xvcd:xvcd element.

xvcd:xvcd Element

This element is the root element when you describe XVCD, including namespaces used in alVCs. All XVCD contents need to be described within this element.

Attribute:
id

Set ID value to identify the xvcd:xvcd element.

If omitted, a value is assumed to be not specified.

exclude-result-prefixes

Sets namespaces to be excluded from conversion results, of namespaces used in the source XML documents. For values, describe the namespace prefixes of namespaces to exclude, each separated by a whitespace. If exclude-result-prefixes="#all" is specified, all namespaces within xvcd:xvcd element are excluded.

If omitted, a value is assumed to be not specified.

version (mandatory)

Set XVCD version number. This attribute is mandatory. This must be 1.0.

Content:

The elements available in the xvcd:xvcd element are listed below:

2.2. Converting and Editing an XML Document

The elements and attributes used for the XML document's conversion and edit in the namespace for VC Core are listed below.

xvcd:include Element

Imports XVCD described in another file. Unlike xvcd:import element, replaces XVCD's original xvcd:include element with all child elements included in xvcd:xvcd element of XVCD file specified by href attribute.

Attribute:
href (mandatory)

Set the URI of the XVCD file which you want to import. This attribute is mandatory.

Content:

The xvcd:include element is empty.

xvcd:import Element

Imports XVCD described in another file. If the description which operates the same DOM node exists both in the XVCD file to be imported and in the imported XVCD file, the content of the XVCD file to be imported takes precedence. As many elements as needed can be specified at the beginning of the xvcd:xvcd element. Optional.

The following elements are imported from XVCD described in another file:

xvcd:vocabulary element is not imported.

Attribute:
href (mandatory)

Set the URI of the XVCD file which you want to import. This attribute is mandatory.

Content:

The xvcd:import element is empty.

xvcd:vocabulary Element

Associates vocabulary with the sub-tree at the top of which there exists the specific element of DOM tree built from the source XML document. Be sure to use this element in combination with the xvcd:template element described in another location within the XVCD file.

Attribute:
name (mandatory)

Set the vocabulary name. It can be QName. This attribute is mandatory.

match (mandatory)

Specify the XPath pattern to identify the vertex element of the sub-tree which associates vocabulary. This attribute is mandatory.

call-template (mandatory)

Set named template's name described within the name attribute of xvcd:template element. It can be QName. This attribute is mandatory.

priority

Specify the order of priority of vocabulary. It can be a number.

If omitted, default priority is set.
Default priority is "1.0" if XVCD is associated with XML document by com.xfytec vocabulary-connection processing instruction, otherwise it is "0".

Content:

The elements available in the xvcd:vocabulary element are listed below:

xvcd:template Element

Describes the template rule, which converts the node set of the source XML document's DOM tree, within the element.

Attribute:
name

Set the name used when invoking the template. It can be QName. If the match attribute is not specified, this attribute needs to be described. The template, whose name attribute is set, is called the named template.

If omitted, a value is assumed to be not specified.

match

Specify XPath pattern to identify the element to which the template is applied. If the name attribute is not specified, this attribute needs to be described.

If omitted, a value is assumed to be not specified.

mode

Specify the template rule used when applying the template rule in the xvcd:apply-templates element. It can be QName. If there are multiple template rules in which the same XPath pattern is specified, use each rule depending on the situation. If the mode attribute is set for the xvcd:template element, the template rule of the xvcd:template element, whose value matches the value of the mode attribute of the xvcd:apply-templates element, is applied.

If omitted, a value is assumed to be not specified.

priority

Set the priority of template rule.

The default priority is assigned.

Content:

Within the xvcd:template element, describe template rule.

xvcd:apply-templates Element

Used to apply another template to child node involved in nodes to which the template rule is applied. Specify the node set to which another template is applied using the select attribute and mode attribute. If omitted, another template will apply to all child nodes within the node set.

Attribute:
select

Specify the applied-to node set, in XPath expression,.

If omitted, another template will apply to all child nodes within the node set.

mode

Specify the mode in which the template rule applies. It can be QName. The template rule whose attribute matches the mode attribute specified within xvcd:template element is applied.

If omitted, a value is assumed to be not specified.

Content:

The elements available in the xvcd:apply-templates element are listed below:

xvcd:next-match Element

Describes in the template applied within the xvcd:apply-templates element. When multiple templates can be applied to the node, this element applies the template to which a high priority is set compared to the current template.

Attribute:

No attributes for the element.

Content:

The elements available in the xvcd:next-match element are listed below:

xvcd:filler Element

Describes the template rule which may be applied as fall-back if there is no applicable template rule within the xvcd:apply-templates element and xvcd:text-of element.

Attribute:

No attributes for the element.

Content:

Within the xvcd:filler element, template rule can be described. However, it cannot be the xvcd:param element.

xvcd:call-template Element

Used to invoke the named template.

Attribute:
name (mandatory)

Specify the named template's name. It can be QName. For the named template's name, specify the value described within the name attribute of xvcd:template element. This attribute is mandatory.

Content:

The elements available in the xvcd:call-template element are listed below:

xvcd:param Element

Defines the parameter used for a template.

Attribute:
name (mandatory)

Set the name of a parameter. It can be QName. This attribute is mandatory.

select

Set the XPath expression which indicates initial parameter value. If the template rule is described within the element, the attribute is not available.

If omitted, a value is assumed to be not specified.

Content:

Within the xvcd:param element, template rule can be described. However, it cannot be the xvcd:param element. If the template rule is described, the select attribute is not available.

xvcd:with-param Element

Specifies a parameter value if the template described within the xvcd:apply-templates element and the xvcd:call-template element needs a parameter.

Attribute:
name (mandatory)

Set the name of a parameter. It can be QName. This attribute is mandatory.

select

Specify the XPath expression which indicates the parameter value.

If omitted, the content of the xvcd:with-param element may be treated as the parameter value.

Content:

Within the xvcd:with-param element, template rule can be described. However, it cannot be the xvcd:param element. If the template rule is described, the select attribute is not available.

xvcd:variable Element

Describes a variable in XVCD.

Attribute:
name (mandatory)

Set variable name. It can be QName. This attribute is mandatory.

select

Set the XPath expression which indicates the variable's value. If the template rule is described within the xvcd:variable element, the attribute is not available.

If omitted, a value is assumed to be not specified.

Content:

Within the xvcd:variable element, template rule can be described. However, it cannot be the xvcd:param element. If the template rule is described, the select attribute is not available.

xvcd:user-data Element

Sets data (user data) such as attributes of node without changing the source XML document's DOM tree.

Attribute:
name (mandatory)

Set the name of a user data. It can be QName. This attribute is mandatory.

select

Specifies the node set to which user data is assigned. Specify XPath expression which represents the node set.

If omitted, vocabulary is assigned to the root node of the applied source XML document.

value (mandatory)

Specify the user data's initial value. This can be any string. It can also be described in XPath expression, using the attribute's value template. This attribute is mandatory.

Content:

The xvcd:user-data element is empty.

xvcd:property Element

Describes the information which is not an XML document unit, but is recorded in a system and shared in an archive.

Attribute:
name (mandatory)

Set the property name. It can be QName. This attribute is mandatory.

value (mandatory)

Set the property's initial value. This can be any string. It can also be described in XPath expression, using the attribute's value template. This attribute is mandatory.

Content:

The xvcd:property element is empty.

xvcd:resource Element

Describes resource file which associates the xvcd:vocabulary element. For information about resource file specification, see separately provided materials.

Attribute:
src (mandatory)

Describe resource file's URI.

Content:

The xvcd:resource element is empty.

xvcd:resource-text Element

Used to output a resource text string to the destination document. In general, if you describe the string directly in the template rule, it is output to the destination document. Of the xvcd:resource-text element, the string which is output to the destination document cannot be edited in the canvas.

Attribute:
key (mandatory)

Describe the key of the resource displayed.

Content:

The xvcd:resource-text element is empty.

xvcd:namespace Element

Used to output the namespace node to the destination document. If the namespace prefix you want to output is used for another namespace URI reference for the converted document, an error will occur.

Attribute:
name (mandatory)

Specifies namespace prefix of namespace outputting to the destination document. Specify an attribute value template which returns the value that can be treated as NCName. This attribute is mandatory.

select

Set URI reference of the namespace outputting to the destination document. If output namespace's URI reference is described within the xvcd:namespace element, the attribute is not available.

If omitted, a value is assumed to be not specified.

Content:

Within the xvcd:namespace element, URI reference of the namespace outputting to the destination document can be described. If the namespace URI is described, the select attribute is not available.

xvcd:namespace-alias Element

Used to change the namespace URI reference used in the XVCD file to another namespace URI reference within the destination document and outputting it.

Attribute:
stylesheet-prefix (mandatory)

Describes the namespace prefix corresponding to a namespace URI reference used in the XVCD file. Set the namespace prefix with NCName. If stylesheet-prefix="#default" is specified, the attribute is intended for the default namespace.

result-prefix (mandatory)

Describe namespace prefix corresponding to namespace URI when outputting to the destination document. Set the namespace prefix with NCName. If result-prefix="#default" is specified, the default namespace URI reference is used.

Content:

The xvcd:namespace-alias element is empty.

xvcd:element Element

Used to output a new element to the destination document. Available when changing the outputting element name dynamically during conversion.

Attribute:
name (mandatory)

Sets the name of the element outputting to the destination document. Set the attribute's value template which returns QName. This attribute is mandatory.

namespace

Sets namespace URI which defines outputting element name. Set the attribute's value template which returns URI.

If omitted, a value is assumed to be not specified.

use-attribute-sets

Specified when attribute set defined in xvcd:attribute-set element is used. Describe attribute set names (QName) to use, each separated by a whitespace.

If omitted, attribute set is not used.

Content:

Within the xvcd:element element, the Template rule which is specified as the content, if you output the element to the destination document, can be described. However, it cannot be the xvcd:param element.

xvcd:attribute Element

Used to add a new attribute to the element which is output to the destination document. Available when changing the outputting attribute name dynamically during conversion.

Attribute:
name (mandatory)

Sets the attribute name added to the element outputting to the destination document. Set the attribute's value template which returns QName. This attribute is mandatory.

namespace

Sets namespace URI which defines the attribute name. Set the attribute's value template which returns URI.

If omitted, a value is assumed to be not specified.

Content:

Within the xvcd:attribute element, Template rule which is the attribute's value appended to the element which is output to the destination document can be described. However, it cannot be the xvcd:param element.

xvcd:text Element

Used to output any text string to the destination document. In general, if you describe the string directly in the template rule, it is output to the destination document. The xvcd:text element is available when you want to control the whitespace status which is output to the destination document. Of the xvcd:text element, the string which is output to the destination document cannot be edited in the canvas.

Attribute:
cursor-move-in

Specify whether the caret can be moved to the text string described within the xvcd:text element. It can be true or false. If true is specified, you cannot move the caret into the text string. If false is specified, you cannot move the caret into the text string.

If omitted, false is assumed to be set.

Content:

PCDATA string can be described within the xvcd:text element.

xvcd:processing-instruction Element

Used to output a necessary process instruction to the destination document.

Attribute:
name (mandatory)

Specifies process instruction name to output. Set the attribute's value template which returns NCName. This attribute is mandatory.

Content:

Within the xvcd:processing-instruction element, Template rule which is the content of process instruction which is output to the destination document can be described. However, it cannot be the xvcd:param element.

xvcd:comment Element

Used to output comment of XML format to the destination document.

Attribute:

No attributes for the element.

Content:

Within the xvcd:comment element, Template rule which is the content of the comment which is output to the destination document can be described. However, it cannot be the xvcd:param element.

xvcd:value-of Element

Used to output the text specified by select attribute to the destination document. The text which is output to the destination document in the xvcd:value-of element is unable to be edited.

Attribute:
select (mandatory)

This attribute sets the XPath expression which represents a string. The result of evaluating XPath expression is converted to text by the same method as string() function, and is output to the destination document. This attribute is mandatory.

cursor-move-in

Specify whether the caret can be moved to the text data described within the xvcd:value-of element. It can be true or false. If true is specified, you cannot move the caret into the text data. If false is specified, you cannot move the caret within the text data.

If omitted, false is assumed to be set.

Content:

The xvcd:value-of element is empty.

xvcd:text-of Element

Used to refer to the text node value or attribute node value of source XML document's DOM tree and output it to the destination document as editable text. It differs significantly from xvcd:value-of element in that the output text is editable.

Attribute:
select (mandatory)

Specify source XML document's DOM tree node whose value is referred to and is output to the destination document as text. It can be XPath expression which identifies the node. The source for the text which is output to the destination document may vary according to the node type retrieved by evaluating XPath expression.

  • If the retrieved node is a text node,
    the node's text data is output to the destination document.
  • Attribute node
    the attribute's value is converted to a text and output to the destination document.
  • Element node
    the operation may vary according to the value specified in position attribute. For more information, see position attribute.

If no referenced text node or attribute node is found, the content of filler attribute or the content of vcd:filler element described in vcd:text-of element may be output to as a substitute string. The filler attribute's value, or "???" if nothing is specified in xvcd:filler element, may be output. This attribute is mandatory.

position

If the node type retrieved by evaluating XPath expression described within select attribute is element node, this attribute specifies which text node within the counterpart element will be referred to and the retrieved text will be output to the destination document. The text nodes, from which value and data to set are retrieved, are as follows:

first-child
Outputs the text data retrieved from first child text node within the element.
last-child
Outputs the text data retrieved from last child text node within the element.
before
Outputs the text data retrieved from text node just before the element.
after
Outputs the text data retrieved from text node just after the element.

If omitted, first-child is assumed to be set.

mutable

Specify whether text data which was output to the destination document is editable. It can be true or false. If true is specified, text data may be editable. And, regardless of the specification in cursor-move-in attribute, you can move the caret into text data. If false is specified, text data may not be editable. If false is specified, the specification in cursor-move-in attribute determines whether you can move the caret into text data.

If omitted, true is assumed to be set.

cursor-move-in

If false is specified in mutable attribute, this attribute determines whether you can move the caret into text data which was output to the destination document. It can be true or false. If true is specified, you cannot move the caret into the text data. If false is specified, you cannot move the caret into the text data. If true is specified in mutable attribute, this attribute's value may be ignored.

If omitted, true is assumed to be specified.

filler

Specify the string to be displayed when there exists no text data to display. If xvcd:filler element is described within the element, it is unavailable.

If omitted and xvcd:filler element is specified in the element, its content is used. Otherwise, "???" is assumed to be specified.

Content:

The elements available in the xvcd:text-of element are listed below:

xvcd:for-each Element

Used to iterate the elements in the desired node set included in the source document.

Attribute:
select (mandatory)

Specify the node set to which iterative process is applied. Specify the XPath expression which identifies the node set. This attribute is mandatory.

Content:

The contents available in the xvcd:for-each element are listed below.

xvcd:sort Element

When outputting the DOM tree node of source XML document, which is compliant with the evaluation of XPath expression specified in select attribute of xvcd:apply-templates element or xvcd:for-each element, to the destination document, this element is used to sort processing orders.

Attribute:
select

Specifies the node set to sort. Specify the XPath expression which returns the node set.

If omitted, "string(.)" is assumed to be specified.

data-type

Specify by an attribute value template whether the node set is sorted by string or the string value converted to number. If it may be sorted by character order, specify text. If it may be sorted by the value converted to number, specify number.

If omitted, text is assumed to be specified.

order

Specify sort order by an attribute value template. If it may be sorted by ascending order, specify ascending. If it may be sorted by descending order, specify descending.

If omitted, ascending is assumed to be specified.

Content:

The xvcd:sort element is empty.

xvcd:if Element

Used when you want to apply a template rule only if the specified condition is satisfied.

Attribute:
test (mandatory)

Describe an XPath expression as a condition. The XPath expression evaluation is treated as a true/false value. If it returns true, the template rule specified within xvcd:if element is applied. This attribute is mandatory.

Content:

Within the xvcd:if element, template rule can be described. However, it cannot be the xvcd:param element.

xvcd:choose Element

Used when you list multiple conditions and want to apply the template rule which corresponds to the first satisfied condition. Use it in combination with xvcd:when element or xvcd:otherwise.

Attribute:

No attributes for the element.

Content:

The elements available in the xvcd:choose element are listed below:

  • xvcd:when Element
    At least one element should be specified. As many elements as needed can be specified.
  • xvcd:otherwise Element
    Only one element can be specified, if needed. Be sure to specify the xvcd:otherwise last within the xvcd:choose element if you specify the xvcd:otherwise element. Optional.

xvcd:when Element

Used to describe conditions enumerated within xvcd:choose element and corresponding template rules.

Attribute:
test (mandatory)

Describe an XPath expression as a condition. The XPath expression evaluation is treated as a true/false value. If it returns true, the template rule specified within xvcd:when element is applied. This attribute is mandatory.

Content:

Within the xvcd:when element, template rule can be described. However, it cannot be the xvcd:param element.

xvcd:otherwise Element

Describes the template rule which is applied when all conditions of xvcd:when elements described in xvcd:choose element will not be satisfied.

Attribute:

No attributes for the element.

Content:

Within the xvcd:otherwise element, template rule can be described. However, it cannot be the xvcd:param element.

xvcd:copy-of Element

Used to copy the content of source XML document's DOM tree node set and outputting it as is to the destination document. And, this element is also used when copying the XML document fragment returned by command instruction to the destination document as is.

Attribute:
select (mandatory)

Specify the document node set which is copied to the destination document. Specify the XPath expression which identifies the node set. This attribute is mandatory.

Content:

The xvcd:copy-of element is empty.

xvcd:copy Element

Used when current node is copied to the destination document. The namespace node of current node is also automatically copied, but its attributes and child nodes are not copied automatically.

Attribute:
use-attribute-sets

Specified when attribute set defined in xvcd:attribute-set element is used for copied element. Describe attribute set names (QName) to use, each separated by a whitespace.

If omitted, attribute set is not used.

Content:

Within the xvcd:copy element, template rule can be described. However, it cannot be the xvcd:param element.

xvcd:command Element

Defines a series of command instruction, such as editing of source XML document, operation of UI object. The context node of xvcd:command element will be one of vertex elements of source XML document. If you want to refer to the node at caret position, retrieve the node using xvcd:caret-node() function.

Attribute:
name (mandatory)

Set the command name. It can be QName. This attribute is mandatory.

checked

Describe XPath expression that indicates command's selection status. XPath expression evaluation is judged as a true/false value. When the command is registered in the menu, if XPath expression evaluates to true, the command name is displayed checked in the menu.

If omitted, a value is assumed to be not specified.

enabled

Describe XPath expression whether to allow selecting menu or tool button commands are assigned. XPath expression evaluation is judged as a true/false value. If the evaluation result for the XPath expression is true, allows the selection.

If omitted, the result whether to be enabled to execute the command instruction describe at the head of xvcd:command element is assumed to be the setting value.

Content:

The following content can be described within xvcd:command element as command instruction column:

  • instruction:param Element
    If a command needs parameters, this element describes their initial value. Any number of elements can be specified, if needed. Optional. When you describe it, be sure to describe the element at the beginning of the xvcd:command element. For more information, see the Platform Command Instruction Reference.
  • Various command instructions
    The command instruction element for XML document editing and platform command instruction may be described. For more information about command instruction element for XML document editing, see the "Command instruction for XML document editing". And for more information about platform command instruction, see the Platform Command Instruction Reference.

xvcd:action Element

Used to describe command instruction corresponding to user operation event performed on the destination document node displayed in canvas.

Attribute:
event (mandatory)

Describe XPath expression which evaluates user operation event represented as XML document fragment. Always evaluated that the event element (event:event) is the current node. XPath expression evaluation is treated as a true/false value. If XPath expression evaluates to true, command instruction column described within xvcd:action element is executed.
If you want to refer to the node on which event occurred using XPath expression, use event:target variable. This attribute is mandatory.

Content:

The following content can be described within xvcd:action element as command instruction column:

  • instruction:param Element
    If a command needs parameters, this element describes their initial value. Any number of elements can be specified, if needed. Optional. When you describe it, be sure to describe the element at the beginning of the xvcd:action element. For more information, see the Platform Command Instruction Reference.
    If you want to receive the event object as a parameter, use the variable name of event:event. And, if you want to receive the node on which event occurred, use the variable name of event:target.
  • Various command instructions
    The command instruction element for XML document editing and platform command instruction may be described. For more information about command instruction element for XML document editing, see the "Command instruction for XML document editing". And for more information about platform command instruction, see the Platform Command Instruction Reference.

xvcd:apply-vocabularies Element

If you apply different vocabulary than the one in use to the sub-tree with its tip at specific element of DOM tree built from source XML document, use this element.

Attribute:
select (mandatory)

Specify the node, in XPath expression, to which another vocabulary is applied. This attribute is mandatory.

* If multiple vocabularies are applied to the same node, only first vocabulary is applied.

name

Set the vocabulary name that has precedence. It can be QName.

If omitted, a vocabulary may be selected according to the priority set in the system.

Content:

The xvcd:apply-vocabularies element is empty.

xvcd:message Element

Outputs a message to the processor which processes XVCD. The output message is processed by the processor which processes XVCD.

Attribute:

No attributes for the element.

Content:

Within the xvcd:message element, template rule can be described. However, it cannot be the xvcd:param element. The content described as template rule is, as message, output to the processor which processes XVCD.

xvcd:key Element

Defines the key to be associated with specific node in source XML document. The key associated with the node is available when the node is referred to by using xvcd:key() function.

Attribute:
name (mandatory)

Specify the key name by QName. This attribute is mandatory.

match (mandatory)

Set XPath pattern in order to identify the node for setting the key. This attribute is mandatory.

use (mandatory)

Specify the XPath expression which represents the key value.
For this XPath expression, the node to associate the key evaluates to a context node. If evaluation is node set, multiple strings to which each node evaluated are associated. If evaluation is other than node set, string that evaluated to single string is associated.

Content:

The xvcd:key element is empty.

xvcd:number Element

Inserts formatted numeric value according to the format into destination document. If value attribute is specified, the numeric value to which its XPath expression evaluated is used. If value attribute is not specified, it is evaluated according to level, count, from attributes.

Attribute:
level

Specify the level of target source XML document. Specify one of single, multiple, any:

single is assumed to be specified.

count

Specify XPath pattern that specifies the node to count.

Use XPath pattern compliant with all nodes that have the same node type as current node. And, if current node has expanded name, use XPath pattern compliant with all nodes with the same expanded name.

from

Specify XPath pattern that specifies the location to start counting.

Starts to count from the vertex node.

value

Specify the XPath expression which represents the displayed numeric value.

The numeric value is evaluated according to level, count, from attributes.

format

Specify the format used when converting from numeric to string. Describe the format in the same format as the format attribute of xsl:number element.

"1" is assumed to be specified.

Content:

The xvcd:number element is empty.

xvcd:attribute-set Element

Defines an attribute set. The attribute set defined in this element is available in the following use-attribute-set attributes:

Attribute:
name (mandatory)

Define the attribute set name by QName. This attribute is mandatory.

use-attribute-sets

Set if attribute set already defined in other xvcd:attribute-set element is used. Describe attribute set names (QName) to use, each separated by a whitespace.

If omitted, attribute set already defined in other xvcd:attribute-set element is not used.

Content:

The elements available in the xvcd:attribute-set element are listed below:

xvcd:apply-imports Element

Specifies in the template applied in xvcd:apply-templates element. This element applies the XVCD template imported from another file to the node.

Attribute:

No attributes for the element.

Content:

The xvcd:apply-imports element is empty.

xvcd:strip-space Element

Defines element set, of elements described in source XML document, that may delete whitespace.

Attribute:
elements (mandatory)

Describe XPath patterns to identify the element that may delete whitespace, each separated by a whitespace.

Content:

The xvcd:strip-space element is empty.

xvcd:preserve-space Element

Defines element set, of elements described in source XML document, that should hold whitespace.

Attribute:
elements (mandatory)

Describe XPath patterns to identify the element that should hold whitespace, each separated by a whitespace.

Content:

The xvcd:preserve-space element is empty.

xvcd:decimal-format Element

Defines a format for the decimal number used in xvcd:format-number() function.

Attribute:
name

Define the format name for decimal number by QName.

If omitted, defines decimal number format used by default.

decimal-separator

Specify the character used as decimal point symbol.

If omitted, period character (.) is used.

grouping-separator

Specify the character used for separator symbol for grouping (for example, a thousand unit).

If omitted, comma character (,) is used.

infinity

Specify the string used to indicate infinity.

If omitted, string "Infinity" is used.

minus-sign

Specify the character used as minus symbol.

If omitted, hyphen character (-) is used.

NaN

Specify the string used to indicate NaN type value.

If omitted, string "NaN" is used.

percent

Specify the character used as percent sign.

If omitted, percent sign (%) is used.

per-mille

Specify the character used as permille (permillage) sign.

If omitted, permille sign (#x2030 in Unicode) is used.

zero-digit

Specify the character used to note zero.

If omitted, zero in Arabic numerals (0) is used.

digit

Specify the character used for numerical notation involved in format string pattern.

If omitted, number sign (#) is used.

pattern-separator

Specify the character used to separate plus and minus sub-patterns in format string pattern.

If omitted, semicolon character (;) is used.

Content:

The xvcd:decimal-format element is empty.

xvcd:output Element

xfy technology user agent does nothing for this element. Provided for compatibility with XSLT.

Attribute:

No attributes for the element.

Content:

The xvcd:output element is empty.

xvcd:fallback Element

xfy technology user agent does nothing for this element. Provided for compatibility with XSLT.

Attribute:

No attributes for the element.

Content:

Within the xvcd:fallback element, template rule can be described. However, it cannot be the xvcd:param element.

2.3. Creating a New XML Document

In VC core namespace, the following elements and attributes are used to describe a new XML document's template:

xvcd:document-template Element

Describes a new XML document template within an element, created by using the currently processed XVCD.

Attribute:
name (mandatory)

Describe new XML document's template name. This can be the ID string. Use the name described within this attribute if you specify an XML document fragment in new scheme For more information on new schemes, see the New XML Document Creation Scheme Reference. This attribute is mandatory.

save-url

Specify the default location when a newly created XML document is stored. It can be URL. It is used for the same purpose as save-url key of new scheme's additional information. When used also with save-url key of new scheme, new scheme takes precedence. For more information on new schemes, see the New XML Document Creation Scheme Reference.

If omitted, an attribute value is not assumed to be set.

target

Set whether to publish a new XML document template to the other vocabulary. It can be private or common. If set to common, a new XML document template within an element is published. If set to private, it is not published. The published new XML document template can be used from the other vocabulary.

If omitted, private is assumed to be set.

resource-url

Specify resource file that is associated with new XML document template. It can be URL. Valid if common is set as target attribute value.

If omitted, an attribute value is not assumed to be set.

Content:

Within xvcd:document-template element, new XML document's template or XVCD template rule can be described. If new XML document's template is described, the content of xvcd:document-template element is described in XML document built-in format. Therefore, you should to observe the following rule to describe a direct descendent of xvcd:document-template element:

  • Zero or more process instructions can be described within a direct descendent of xvcd:document-template element.
  • Be sure to describe only one element within a direct descendent of xvcd:document-template element. If no element is described or multiple elements are described, it may not be processed correctly.
  • Any text other than whitespace cannot be described in a direct descendent of xvcd:document-template element.

2.4. Template Rule

For template rule, XVCD element and literal result element can be described. Describable XVCD elements within the template rule are as follows:

2.5. Command Instruction for Editing an XML Document

In VC core namespace, elements and attributes defined as command instruction for XML document editing are as follows:

xvcd:combine Instruction

Combines two contiguous nodes. The each node to be combined must be the same type. Blank node or comment node between specified node and succeeding node is ignored during combining.

If the attributes set to the combined nodes are different, the attribute set to the preceding node in the document is reflected to the combined node.

If select attribute is specified, the node specified by select attribute is combined with the previous node (if to attribute value is before) or with the node after it (if to attribute value is after).

If select attribute is not specified, judges whether to be able to combine or not by satisfying the following conditions:

  • Main element (compliant with xvcd:main-elements element) exists on the ancestor of the node at the caret position (if multiple elements exists, the element nearest to the caret is selected).
  • If to attribute value is before, the caret position points the head of the text or the object included in the main element.
  • If to attribute value is after, the caret position points the end of the text or the object included in the main element.

If the condition is satisfied, whether to combine the main element and the target element by type attribute of xvcd:mein-elements element (main combination) is judged.

If the main-combination is performed, then it attempts to combine the child nodes at the combination point (sub-combination). If the candidate node for the combination is compliant with the sub-element (compliant with xvcd:sub-elements element), whether to be able to combine by using type attribute of xvcd:sub-elements element is judged. If the candidate node is text node, it is always combined.

If the sub-combination is performed, then it attempts to combine the child nodes sub-combination at the combination point.

Attribute:
select

Specify target node to combine. It can be an XPath expression.

If omitted, combines according to the element described within the contents.

to

Specify the direction of combination for combined nodes by an attribute value template. It can be before or after.

If omitted, after is set.

Content:

The elements available in the xvcd:combine element are listed below:

xvcd:copy-selection Instruction

Copies the selected range as XML document fragment in canvas and stores it to a variable.

Attribute:
return-to (mandatory)

Specify the variable which stores the copied XML document fragment. It can be QName. This attribute is mandatory.

Content:

The xvcd:copy-selection element is empty.

xvcd:default Instruction

Describes the process to be performed if the node cannot be combined by the xvcd:combine element, or cannot be separated by the xvcd:split element. Available only within the contents of the xvcd:combine element and the xvcd:split element.

Attribute:
command

Specify the command name to execute. It can be QName .

If omitted, a value is assumed to be not specified. If this is the case, the command instruction column described within the xvcd:default element is executed.

Content:

The following content can be described within xvcd:default element as command instruction column:

  • instruction:param Element
    If a command needs parameters, this element describes their initial value. Any number of elements can be specified, if needed. Optional. When you describe it, be sure to describe the element at the beginning of the xvcd:action element. For more information, see the Platform Command Instruction Reference.
  • Various command instructions
    The command instruction element for XML document editing and platform command instruction may be described. For more information about command instruction element for XML document editing, see the "Command instruction for XML document editing". And for more information about platform command instruction, see the Platform Command Instruction Reference.
Exception:

xvcd:delete Instruction

Performs delete operation based on the evaluation of XPath expression specified in select attribute. The delete operation may vary according to XPath expression evaluation. Each case and operation is as follows:

If the expression evaluates to range,
texts and nodes within the range will be deleted.
If the expression evaluates to node set,
all nodes within the node set will be deleted.
If evaluation is a range,
a character at caret position will be deleted according to the backspace attribute.
Attribute:
select (mandatory)

Specify delete candidate. It can be an XPath expression. XPath expression may evaluate to range or node set. This attribute is mandatory.

backspace

Specify the behavior when a character will be deleted. It can be yes or no. If yes is specified, character at the left of caret position will be deleted. If no is specified, character at the right of caret position will be deleted.

If omitted, at the behavior to delete a character, the attribute is assumed to be set to no.

Content:

The xvcd:delete element is empty.

xvcd:get-clip Instruction

Retrieves XML document fragment in the clipboard and stores it to a variable.

Attribute:
return-to (mandatory)

Specify the variable which stores XML document fragment in the clipboard. It can be QName. The XML document fragment stored in the variable specified in return-to attribute contains the following elements:

Content:

The xvcd:get-clip element is empty.

xvcd:insert Instruction

Inserts the XML document fragment into the source XML document. Specify the position into which XML document fragment is inserted using the ref attribute and the position attribute. After command instruction is executed, the caret moves to the position before the XML document fragment was inserted.

Attribute:
ref (mandatory)

Specify the node to insert XML document fragment or specifies range. It can be an XPath expression. The reference node of the insert position can be the node specified in the ref attribute, or range. This attribute is mandatory.

position

Specify the insert position of the XML document fragment relative to the reference node specified in the ref attribute. It can be the attribute value template that returns the following string:

before
Inserts XML document fragment before the reference node.
after
Inserts XML document fragment after the reference node.
first-child
Inserts XML document fragment as first child node of the reference node.
last-child
Inserts XML document fragment as last child node of the reference node.
caret
Divides the reference node at caret position and inserts XML document fragment.

If omitted, before is assumed to be specified.

select

Specify, using node set, the XML document fragment to be inserted into the source XML document. It can be an XPath expression. If namespace node, which declares the namespace used within specified the XML document fragment, is outside of the XML document fragment, the XML document fragment does not inherit the namespace. Therefore, depending on the insert position of the XML document fragment, namespace prefix may not be defined. So it is recommended that you declare the namespace within the specified XML fragment.

If omitted, the content described within the element will be inserted. Here, if the element is null, an error occurs.

combine

Specify the combination of the inserted node of the XML document fragment and the separated node at the inserted position when caret is set to the position attribute. It can be the attribute value template that returns the following string:

both
Combines the inserted and the resulting separated nodes.
preceding
Combines the resulting separated node and the inserted node.
after
Combines the inserted node and the resulting separated node after it.
none
Does not combine nodes.

Combining nodes is performed when the inserted and separated node are the same type.

If omitted, both is assumed to be set.

caret-move

Specify the caret position after an XML document fragment is inserted. It can be the attribute value template that returns the following string:

before
Moves the caret before the inserted XML document fragment.
after
Moves the caret after the inserted XML document fragment.
caret
Does not move the caret from the current position.

If omitted, before is assumed to be set.

Content:

Within the xvcd:insert element, any content which is inserted into the source XML document can be described. If the content is described in the element and the select attribute is specified, the value of the select attribute takes precedence.

xvcd:main-elements Instruction

Describes the condition for combining elements by the xvcd:combine element, or separating an element by the xvcd:split element. Available only within the contents of the xvcd:combine element and the xvcd:split element.

The element of the element group specified by this element can be the vertex for the combination or separation.

Attribute:
test (mandatory)

Specify the condition for the element that combines or separates elements or nodes. It can be a XPath expression returning true/false value. When evaluating XPath expression, the combined or separated node is the context node. This attribute is mandatory.

type

Specify the condition for the node combination. Specify one of the following strings.

grouped
Enables it to combine elements if the target nodes are included in the same group.
strict
Enables it to combine elements if all the attribute values for the target node set to the element names or elements match together within the target element nodes.

If described within the xvcd:split element, the type attribute can be omitted. If described within the xvcd:combine element and omitted, the grouped is assumed to be specified.

Content:

The xvcd:main-elements element is empty.

xvcd:move Instruction

Moves the XML document fragment in the source XML document to the specified position.

Attribute:
select (mandatory)

Specify, using node set, the XML document fragment to move. It can be an XPath expression. If namespace node, which declares the namespace used within specified the XML document fragment, is outside of the XML document fragment, the XML document fragment does not inherit the namespace. Therefore, depending on the destination of the XML document fragment, namespace prefix may not be defined. So it is recommended that you declare the namespace within the specified XML fragment. This attribute is mandatory.

ref (mandatory)

Specify the destination node of the XML document fragment or specifies range. It can be an XPath expression. The reference node of destination can be the node specified in the ref attribute, or range. This attribute is mandatory.

position

Specify the insert position of the XML document fragment relative to the reference node specified in the ref attribute. It can be the attribute value template that returns the following string:

before
Inserts XML document fragment before the reference node.
after
Inserts XML document fragment after the reference node.
first-child
Inserts XML document fragment as first child node of the reference node.
last-child
Inserts XML document fragment as last child node of the reference node.
caret
Divides the reference node at caret position and inserts XML document fragment.

If omitted, before is assumed to be specified.

Content:

The xvcd:move element is empty.

xvcd:set-attribute Instruction

Sets attribute to all elements included in the specified node set and deletes attribute from all elements.

Attribute:
select (mandatory)

Specify the node set to set or delete an attribute. It can be an XPath expression. This attribute is mandatory.

name (mandatory)

Describe an attribute name. It can be the attribute value template that returns QName. This attribute is mandatory.

value

Describe the value which is set to attribute. It can be the attribute value template.

If omitted, the attribute whose name is specified in the name attribute is deleted from the element.

Content:

The xvcd:set-attribute element is empty.

xvcd:set-clip Instruction

Transfers the specified node set to the clipboard.

For the node set, specify the XML document fragment described in the data conversion namespace. If an XML document fragment that is not a data conversion namespace is specified as the target, it is compensated according to Compensation of data conversion. For more information about the data conversion namespace, see Data Conversion Reference.

Attribute:
select

Specify the node set which is transferred to the clipboard. It can be an XPath expression.

If omitted, the content described in the element is transferred to the clipboard.

Content:

Within the xvcd:set-clip element, any content which is transferred to the clipboard can be described. If the content is described in the element and the select attribute is specified, the value of the select attribute takes precedence.

xvcd:set-property Instruction

Changes the value of the property defined within the xvcd:property element.

Attribute:
name (mandatory)

Specify the name of the property whose value you want to change. It can be the attribute value template that returns QName. This attribute is mandatory.

value (mandatory)

Describe the value which is set to property. It can be the attribute value template that returns string. This attribute is mandatory.

Content:

The xvcd:set-property element is empty.

xvcd:set-text Instruction

Replaces text data of the node specified in XPath expression with other text data.

Attribute:
select (mandatory)

Specify the text data whose content is replaced. It can be XPath expression which identifies the node. Depending on the node type retrieved by evaluating XPath expression, the way to determine target text data may vary.

  • If the resulting node is a text node, the contents of the node are replaced with the value attribute's value.
  • If it is an attribute node, the attribute value is replaced with the value attribute's value.
  • If it is an element node, the target text node is determined by the position attribute.

If the specified XPath expression satisfies the following conditions, the text data is specified by complementing the element or attribute within the XPath. If the element is complemented, it is inserted as the head child node of the parent.

  1. The predicate is not described in each location step of the XPath expression.
  2. The axis used is only the child axis or the attribute axis.
  3. The node test is described in QName.
value (mandatory)

Set the text data which is replaced. It can be the attribute value template that returns string. This attribute is mandatory.

position

Specify the position of the text node that sets the text data if the node specified by the select attribute is an element node. Describes one of the following strings.

before
Sets the text data to the immediately preceding text node of the element node. If no immediately preceding node exists, or the immediately preceding is not text node, it sets the text data by inserting the text node immediately preceding it.
after
Sets the text data to the immediately following text node of the element node. If no immediately following node exists, or the immediately following is not text node, it sets the text data by inserting the text node immediately following it.
first-child
Sets the text data to the text node of the element node, which is the child of the head node. If no child node exists, or the child of the head node is not text node, it sets the text data by inserting the text node at the head of it.
last-child
Sets the text data to the text node of the element node, which is the child of the end node. If no child node exists, or the child of the end node is not text node, it sets the text data by inserting the text node at the end of it.

If omitted, the first-child is assumed to be set.

Content:

The xvcd:set-text element is empty.

xvcd:set-user-data Instruction

Changes the value of user data defined within the xvcd:user-data element.

Attribute:
name (mandatory)

Specify the name of user data to change its value. It can be the attribute value template that returns QName. This attribute is mandatory.

value (mandatory)

Describe the value which is set to user data. It can be the attribute value template that returns string. This attribute is mandatory.

select

Specify the node set to which user data is assigned. It can be an XPath expression.

If omitted, vocabulary is assigned to the root node of the applied source XML document.

Content:

The xvcd:set-user-data element is empty.

xvcd:split Instruction

Divides the node into two at caret position.

If the select attribute is specified, the node indicated by the select attribute is separated into two nodes at the caret position.

If the select attribute is not specified, the node is separated only when the conditions listed below are satisfied.

  • Main element (compliant with xvcd:main-elements element) exists on the ancestor of the node at the caret position (if multiple elements exists, the element nearest to the caret is selected).
  • The node can be separated for all of these: the node at the caret position, the node of the selected main element, and all the nodes which exist between them.
  • Always can be separated if it is text node, separated if the element is compliant with xvcd:main-elements or xvcd:sub-elements element, otherwise unable to be separated.
Attribute:
select

Specify the target node to divide. It can be an XPath expression.

If omitted, separates according to the element described within the contents.

Content:

The elements available in the xvcd:split element are listed below:

xvcd:start-drag Instruction

Prompts you to start a drag and drop when drag start event is received. Specifies the object to be dragged.

For the dragging target, specify the XML document fragment described in the data conversion namespace. If an XML document fragment that is not a data conversion namespace is specified as the target, it is compensated, Compensation of data conversion. For more information about the data conversion namespace, see Data Conversion Reference.

Attribute:
event (mandatory)

Set the event object. This attribute is mandatory.

Content:

The dragged target can be described within the xvcd:start-drag element. If you drag and drop the selected range, the XML document fragment created by using the xvcd:copy-selection element is output by the xvcd:copy-of element. Any XML document fragment may also be described.

xvcd:sub-elements Instruction

Describes the condition for combining elements by the xvcd:combine element, or separating an element by the xvcd:split element. Available only within the contents of the xvcd:combine element and the xvcd:split element.

This element is not the top of the node tree combined or separated, but specifies the element group that is the child of the node.

Attribute:
test (mandatory)

Specify the condition for the element that combines or separates elements or nodes. It can be a XPath expression returning true/false value. When evaluating XPath expression, the combined or separated element is the context node. This attribute is mandatory.

type

Specify the condition for the element combination. This can be described in one of the following strings.

grouped
Enables it to combine elements if the target elements are included in the same group.
strict
Enables it to combine elements if all the attribute values set to the element names or elements match together within the target element.

If described within the xvcd:split element, the type attribute can be omitted. If described within the xvcd:combine element and omitted, the grouped is assumed to be specified.

Content:

The xvcd:sub-elements element is empty.

xvcd:surround-contents Instruction

Encloses selected range in the specified element. If the range is not selected, it is inserted as a null element at the caret position.

Attribute:
parent-name (mandatory)

Describe the namespace of the element in which the selected range is enclosed. It can be the attribute value template that returns QName. This attribute is mandatory.

parent-namespace

Describe the namespace of the element in which the selected range is enclosed. It can be the attribute value template that returns URI reference string.

If omitted, the namespace URI that expands the prefix of parent-name is used.

Content:

The xvcd:surround-contents element is empty.

xvcd:unsurround-contents Instruction

Deletes the element tag included in the specified node set.

Attribute:
select (mandatory)

Specify the node set which deletes the element tag. It can be an XPath expression. This attribute is mandatory.

Content:

The xvcd:unsurround-contents element is empty.

2.6. Function

Namespace for Function

In order to improve the compatibility with XSLT, the following functions can be invoked without namespace (namespace URI reference is null string) only when they are used in XVCD. However, we recommend you to specify namespace as much as possible.

The functions defined in the VC Core namespace are listed below.

xvcd:user-data Function

Retrieves the user data's value from the node.

Syntax:
string xvcd:user-data( userdata_name, node_set? )
Argument:
string userdata_name

Specify the name of user data for retrieving its value.

node-set node_set

Specify the node to which user data for obtaining its value is assigned in XPath expression. If there exists multiple nodes which are compliant with XPath expression, the first node is selected as the target.

If omitted, the root node of the source XML document applied by vocabulary is intended for.

Return value:
string

Returns user data's value. If user data with the name specified by userdata_name does not exist, it returns a null string.

xvcd:property Function

Retrieves the property's value.

Syntax:
string xvcd:property( property_name, default_value? )
Argument:
string property_name

Specify the name of property for retrieving its value.

string default_value

Specify the value that is returned if the property with the name specified by property_name does not exist.

If omitted, an error occurs if the property with the name specified by property_name does not exist. In order to check whether the property exists, use the xvcd:property-exists() function.

Return value:
string

Returns property's value. If the property with the name specified by property_name does not exist, the default value by default_value is returned. Here, if default_value is omitted, an error occurs.

xvcd:property-exists Function

Checks whether the property with the name exists, by specifying property name.

Syntax:
boolean xvcd:property-exists( property_name )
Argument:
string property_name

Specify the name of the property whose existence you want to check.

Return value:
boolean

This returns a true/false value. If the property with the name specified by an argument exists, it returns true. If the property does not exist, it returns false.

xvcd:string-resource Function

Retrieves and returns the string resource with the key passed by an argument from the resource file specified by the xvcd:resource element.

Syntax:
string xvcd:string-resource( resource_key )
Argument:
string resource_key

Specify the key string of the string resource described in the resource file.

Return value:
string

Retrieves the string resource with the key passed by an argument from the resource file specified by the xvcd:resource element, and returns it in string format. If string resource with the key specified by the argument does not exist, it returns a null string.

xvcd:url-resource Function

Retrieves and returns the URL resource with the key passed by an argument from the resource file specified by the xvcd:resource element.

Syntax:
string xvcd:url-resource( resource_key )
Argument:
string resource_key

Specify the key string of the URL resource described in the resource file.

Return value:
string

Retrieves the URL resource with the key passed by an argument from the resource file specified by the xvcd:resource element, and returns it in URL string format. If URL resource with the key specified by the argument does not exist, it returns a null string.

xvcd:caret-node Function

Returns the node at caret position as the node set.

Syntax:
node-set xvcd:caret-node( )
Argument:

No argument.

Return value:
node-set

Returns the node at caret position as the node set. If caret does not exists, a null node set is returned.

xvcd:selection-range Function

Returns the object which represents the selected range.

Syntax:
range xvcd:selection-range( )
Argument:

No argument.

Return value:
range

Returns the object which represents the selected range.

xvcd:selection-collapsed Function

Returns whether the selected range exists.

Syntax:
boolean xvcd:selection-collapsed( )
Argument:

No argument.

Return value:
boolean

Returns, as a true/false value, whether the selected range exists. If the selected range does not exist, true is returned. If the property exists, it returns false.

xvcd:caret-char-offset Function

Returns the offset position from the beginning of the text node when the caret points the text node.

Syntax:
number xvcd:caret-char-offset( )
Argument:

No argument.

Return value:
number

Returns the offset position from the beginning of the text node. The minimum value is zero, and the maximum value is the number of characters of the text node. If the caret is not within the text node, -1 is returned.

xvcd:caret-char-count Function

Returns the number of characters included in the text node when the caret points to the text node.

Syntax:
number xvcd:caret-char-count( )
Argument:

No argument.

Return value:
number

Returns the number of characters included in the text node. If the caret is not within the text node, -1 is returned.

xvcd:readonly-dom Function

Checks whether the DOM tree including the target node is reference only.

Syntax:
boolean xvcd:readonly-dom( reference-node? )
Argument:
node-set reference-node

Specify the target node.

If omitted, the context node is assumed to be the target node.

Return value:
boolean

Returns true if the DOM tree including the target node is reference only. If it is not reference only, false is returned.

xvcd:key Function

Specified key returns the node set associated by xvcd:key element.

Syntax:
node-set xvcd:key( name, value )
Argument:
string name

Specify the key name by QName.

object value

It can be a key value. If the value is node-set, multiple strings to which each node evaluated are set as value. If the value is other than node-set, string that evaluated to single string is set as a value.

Return value:
node-set

Returns all nodes as node set that have the specified key.

xvcd:format-number Function

Converts a numeric value to formatted string by using specified format pattern string and decimal number format.

Syntax:
string xvcd:format-number( number, pattern, name? )
Argument:
number number

Specify a numeric value to format and output.

string pattern

Specify format pattern string used when outputting numeric value.

string name

Specify the name of decimal number format applied to numeric value by QName.
Specify the decimal number format in xvcd:decimal-format element.

Uses default decimal number format string.

Return value:
string

Returns the formatted numeric string.

xvcd:document Function

Loads another document. This function is compatible with XSLT document() function.

Syntax:
node-set xvcd:document( object, base-node? )
Argument:
object object

Specifies an URI reference of the document to load. Specify the node set or string.
If the specified value is node set, each node evaluates to string, and loads a document based on the string as URI reference. If the specified value is not node set, the value evaluates to string, and loads a document based on the string as URI reference.

node-set base-node

If URI reference specified by first argument is relative path, specify reference URI to convert it to absolute path. It can be a node.

If node set is specified as first argument, uses the node. Otherwise, uses the node in XVCD where this function is described.

Return value:
node-set

Returns node set including root node of all loaded documents.