Languages"

From Documentation
Line 4: Line 4:
 
A language (<javadoc>org.zkoss.zk.ui.metainfo.LanguageDefinition</javadoc>) is a collection of component definitions. It is also known as a component set.
 
A language (<javadoc>org.zkoss.zk.ui.metainfo.LanguageDefinition</javadoc>) is a collection of component definitions. It is also known as a component set.
  
For example, <javadoc>org.zkoss.zul.Window</javadoc>, <javadoc>org.zkoss.zul.Button</javadoc> and <javadoc>org.zkoss.zul.Combobox</javadoc> all belong to the same language called <code>xul/html</code>, which is also known as <code>zul</code>.
+
For example, <javadoc>org.zkoss.zul.Window</javadoc>, <javadoc>org.zkoss.zul.Button</javadoc> and <javadoc>org.zkoss.zul.Combobox</javadoc> all belong to the same language called <code>xul/html</code>. It is a ZK variant of XUL (and also known as <code>zul</code>).
  
Component designers are free to designate a component definition to any component set they prefer, as long as there is no name conflict. In additions, it is OK to use components from several languages in the same ZUML page.
+
Component designers are free to designate a component definition to any component set they prefer, as long as there is no name conflict<ref>For more information please refer to [[ZK Component Development Essentials]]</ref>.
 +
 
 +
=Standard Languages=
 +
 
 +
ZK provides three different languages (aka., component sets): xul/xhtml, xhtml and xml. The xul/xhtml and xhtml langauges can be used for any modern browser (Ajax assumed), while the zml language is used for generating XML document (non-Ajax). Developers are free to add their own language.
 +
 
 +
{| border='1px' | width="100%"
 +
! Language !! Description
 +
|-
 +
| xul/html
 +
|
 +
Name: xul/html
 +
File Extensions: zul, xul
 +
Namespace: http://www.zkoss.org/2005/zul
 +
Namespace shortcut: zul
 +
Device: Ajax
 +
 
 +
XUL-compliant component sets. We adopt [https://developer.mozilla.org/En/XUL XUL] for this language, if the specification is applicable. For more information, please refer to the [[ZUML Reference/ZUML/Languages/ZUL|ZUL]] section and  [[ZK Component Reference]].
 +
 
 +
|-
 +
| xhtml
 +
|
 +
Name: xhtml
 +
File Extensions: zhtml, xhtml, html, htm
 +
Namespace: http://www.w3.org/1999/xhtml
 +
Namespace shortcut: xhtml
 +
Device: Ajax
 +
 
 +
XHTML-compliant component sets. It is one-to-one mapping of XHTML tags to ZK components. Since they are components, you can add and remove them dynamically (and control it at the server). For more information please refer to the [[ZUML Reference/ZUML/Languages/ZHTML|ZHTML]] section or [[ZK Component Reference/XHTML Components|ZK Component Reference]].
 +
 
 +
'''Performance Tip:''' The XHTML language is designed to allow application to modify the client dynamically (at the server). If you don't need it (it is generally true), you shall use the [[ZK Developer's Reference/UI Composing/ZUML/Standard Namespaces/Native Namespace|Native namespace]] instead. For more information, please refer to [[ZK Developer's Reference/Performance Tips/Use Native Namespace instead of XHTML Namespace|Performance Tips]].
 +
 
 +
|-
 +
| xml
 +
|
 +
Name: xml
 +
File Extensions: xml
 +
Namespace: http://www.zkoss.org/2007/xml
 +
Namespace shortcut: xml
 +
Device: XML
 +
Available only ZK EE
 +
 
 +
XML component sets. It is used to generate (static) XML document. For more information please refer to the [[ZUML Reference/ZUML/Languages/XML|XML]] section.
 +
|}
  
 
{{ZUMLReferenceHeadingToc}}
 
{{ZUMLReferenceHeadingToc}}
 +
 +
<blockquote>
 +
----
 +
<references/>
 +
</blockquote>
  
 
=Version History=
 
=Version History=

Revision as of 08:07, 5 November 2010

Overview

A language (LanguageDefinition) is a collection of component definitions. It is also known as a component set.

For example, Window, Button and Combobox all belong to the same language called xul/html. It is a ZK variant of XUL (and also known as zul).

Component designers are free to designate a component definition to any component set they prefer, as long as there is no name conflict[1].

Standard Languages

ZK provides three different languages (aka., component sets): xul/xhtml, xhtml and xml. The xul/xhtml and xhtml langauges can be used for any modern browser (Ajax assumed), while the zml language is used for generating XML document (non-Ajax). Developers are free to add their own language.

Language Description
xul/html
Name: xul/html
File Extensions: zul, xul
Namespace: http://www.zkoss.org/2005/zul
Namespace shortcut: zul
Device: Ajax

XUL-compliant component sets. We adopt XUL for this language, if the specification is applicable. For more information, please refer to the ZUL section and ZK Component Reference.

xhtml
Name: xhtml
File Extensions: zhtml, xhtml, html, htm
Namespace: http://www.w3.org/1999/xhtml
Namespace shortcut: xhtml
Device: Ajax

XHTML-compliant component sets. It is one-to-one mapping of XHTML tags to ZK components. Since they are components, you can add and remove them dynamically (and control it at the server). For more information please refer to the ZHTML section or ZK Component Reference.

Performance Tip: The XHTML language is designed to allow application to modify the client dynamically (at the server). If you don't need it (it is generally true), you shall use the Native namespace instead. For more information, please refer to Performance Tips.

xml
Name: xml
File Extensions: xml
Namespace: http://www.zkoss.org/2007/xml
Namespace shortcut: xml
Device: XML
Available only ZK EE

XML component sets. It is used to generate (static) XML document. For more information please refer to the XML section.


Subsections:



  1. For more information please refer to ZK Component Development Essentials

Version History

Last Update : 2010/11/5

Version Date Content
     



Last Update : 2010/11/05

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.