XML Namespaces"

From Documentation
Line 10: Line 10:
 
<source lang="xml">
 
<source lang="xml">
 
<combobox xmlns:w="client" w:onFocus="this.open()" onChange="doOnChange()"/>
 
<combobox xmlns:w="client" w:onFocus="this.open()" onChange="doOnChange()"/>
 +
</source>
 +
 +
The [[ZUML Reference/ZUML/Namespaces/Native|native namespace]] is another standard namespace used to indicate a XML element shall be generated ''natively'', rather than a component. For example,
 +
 +
<source lang="xml">
 +
<n:table xmlns:n="native">
 +
  <n:tr>
 +
    <n:td>Username</n:td>
 +
    <n:td><textbox/></n:td>
 +
  </n:tr>
 +
  <n:tr>
 +
    <n:td>Password</n:td>
 +
    <n:td><textbox type="password"/></n:td>
 +
  </n:tr>
 +
</n:table>
 
</source>
 
</source>
  

Revision as of 06:20, 3 December 2010

In a ZUML document, a XML namespace is used to identify either a special functionality or a component set. We call the former as a standard namespace, while the later as a language.

Standard Namespaces

For example, the client namespace is used to identify that a XML attribute shall be interpreted as a client-side control.

In the following example, w:onFocus is a client-side listener since w: is specified, while onChange is

<combobox xmlns:w="client" w:onFocus="this.open()" onChange="doOnChange()"/>

The native namespace is another standard namespace used to indicate a XML element shall be generated natively, rather than a component. For example,

<n:table xmlns:n="native">
  <n:tr>
    <n:td>Username</n:td>
    <n:td><textbox/></n:td>
  </n:tr>
  <n:tr>
    <n:td>Password</n:td>
    <n:td><textbox type="password"/></n:td>
  </n:tr>
</n:table>

For more information, please refer to ZUML Reference.

Languages

Version History

Last Update : 2010/12/03


Version Date Content
     



Last Update : 2010/12/03

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