<?xml version="1.0" encoding="UTF-8" ?>

<!--
Purpose:
	Defines methods and actions for DSP
Description:
	
Histroy:
	Mon Jun 20 20:57:56     2005, Created by tomyeh

Copyright (C) 2005 Potix Corporation. All Rights Reserved.
-->

<taglib>
	<uri>http://www.zkoss.org/dsp/web/core</uri>
	<description>
	Core methods and tags for zweb in DSP
	</description>

	<!--      -->
	<!-- Tags -->
	<!--      -->
	<tag>
		<description>
	Provides the context for mutually exclusive conditional execution.
		</description>
		<name>choose</name>
		<tag-class>org.zkoss.web.servlet.dsp.action.Choose</tag-class>
	</tag>
	<tag>
		<description>
	Iterators thru a collection/array of items.
		</description>
		<name>forEach</name>
		<tag-class>org.zkoss.web.servlet.dsp.action.ForEach</tag-class>
	</tag>
	<tag>
		<description>
	Tests whether an condition is true and render the child only
	if the condition is true.
		</description>
		<name>if</name>
		<tag-class>org.zkoss.web.servlet.dsp.action.If</tag-class>
	</tag>
	<tag>
		<description>
	Includes the specified page.
		</description>
		<name>include</name>
		<tag-class>org.zkoss.web.servlet.dsp.action.Include</tag-class>
	</tag>
	<tag>
		<description>
	Represents the last alternative within a choose action.
		</description>
		<name>otherwise</name>
		<tag-class>org.zkoss.web.servlet.dsp.action.Otherwise</tag-class>
	</tag>
	<tag>
		<description>
	Generates the specified value into a string.
		</description>
		<name>out</name>
		<tag-class>org.zkoss.web.servlet.dsp.action.Out</tag-class>
	</tag>
	<tag>
		<description>
	Sets the page info, such as the content type.
		</description>
		<name>page</name>
		<tag-class>org.zkoss.web.servlet.dsp.action.Page</tag-class>
	</tag>
	<tag>
		<description>
	Remove an attribute.
		</description>
		<name>remove</name>
		<tag-class>org.zkoss.web.servlet.dsp.action.Remove</tag-class>
	</tag>
	<tag>
		<description>
	Sets an attribute.
		</description>
		<name>set</name>
		<tag-class>org.zkoss.web.servlet.dsp.action.Set</tag-class>
	</tag>
	<tag>
		<description>
	Represents an alternative within a {@link Choose} action.
		</description>
		<name>when</name>
		<tag-class>org.zkoss.web.servlet.dsp.action.When</tag-class>
	</tag>

	<!--         -->
	<!-- Imports -->
	<!--         -->
	<import>
		<import-name>ServletFns</import-name>
		<import-class>org.zkoss.web.fn.ServletFns</import-class>
	</import>
	<import>
		<import-name>Labels</import-name>
		<import-class>org.zkoss.util.resource.Labels</import-class>
	</import>

	<!--                 -->
	<!-- Class Utilities -->
	<!--                 -->
	<function>
		<name>boolean</name>
		<function-class>org.zkoss.xel.fn.CommonFns</function-class>
		<function-signature>boolean toBoolean(java.lang.Object)</function-signature>
		<description>
		Converts the specified object to a boolean.
		</description>
	</function>
	<function>
		<name>number</name>
		<function-class>org.zkoss.xel.fn.CommonFns</function-class>
		<function-signature>java.lang.Number toNumber(java.lang.Object)</function-signature>
		<description>
		Converts the specified object to a number.
		</description>
	</function>
	<function>
		<name>int</name>
		<function-class>org.zkoss.xel.fn.CommonFns</function-class>
		<function-signature>int toInt(java.lang.Object)</function-signature>
		<description>
		Converts the specified object to an integer.
		</description>
	</function>
	<function>
		<name>decimal</name>
		<function-class>org.zkoss.xel.fn.CommonFns</function-class>
		<function-signature>java.math.BigDecimal toDecimal(java.lang.Object)</function-signature>
		<description>
		Converts the specified object to a (big) decimal.
		</description>
	</function>
	<function>
		<name>string</name>
		<function-class>org.zkoss.xel.fn.CommonFns</function-class>
		<function-signature>java.lang.String toString(java.lang.Object)</function-signature>
		<description>
		Converts the specified object to a string.
		</description>
	</function>
	<function>
		<name>char</name>
		<function-class>org.zkoss.xel.fn.CommonFns</function-class>
		<function-signature>char toChar(java.lang.Object)</function-signature>
		<description>
	Converts the specified object to a character.
		</description>
	</function>
	<function>
		<name>class</name>
		<function-class>org.zkoss.lang.Classes</function-class>
		<function-signature>java.lang.Class forNameByThread(java.lang.String)</function-signature>
		<description>
	Returns the class of the specified class name.
		</description>
	</function>
	<function>
		<name>isInstance</name>
		<function-class>org.zkoss.xel.fn.CommonFns</function-class>
		<function-signature>boolean isInstance(java.lang.Object, java.lang.Object)</function-signature>
		<description>
	Tests whether an object (the second argument) is an instance of a class (the first argument).
	You could specify a class or the class name as the first argument.
		</description>
	</function>
	<function>
		<name>length</name>
		<function-class>org.zkoss.xel.fn.CommonFns</function-class>
		<function-signature>int length(java.lang.Object)</function-signature>
		<description>
	Returns the length of a string, array, collection or map.
		</description>
	</function>
	<function>
		<name>new</name>
		<function-class>org.zkoss.xel.fn.CommonFns</function-class>
		<function-signature>java.lang.Object new_(java.lang.Object)</function-signature>
		<description>
	Instantiates the specified class.
	The parameter could be either a string (class name) or a Class instance.
		</description>
	</function>
	<function>
		<name>new1</name>
		<function-class>org.zkoss.xel.fn.CommonFns</function-class>
		<function-signature>java.lang.Object new_(java.lang.Object, java.lang.Object)</function-signature>
		<description>
	Instantiates the specified class and argument.
	The first parameter could be either a string (class name) or a Class instance.
	The second parameter is the argument passed to the constructor.
		</description>
	</function>
	<function>
		<name>new2</name>
		<function-class>org.zkoss.xel.fn.CommonFns</function-class>
		<function-signature>java.lang.Object new_(java.lang.Object, java.lang.Object, java.lang.Object)</function-signature>
		<description>
	Instantiates the specified class and two arguments.
	The first parameter could be either a string (class name) or a Class instance.
	The second parameter is the first argument passed to the constructor.
	The third parameter is the second argument passed to the constructor.
		</description>
	</function>
	<function>
		<name>new3</name>
		<function-class>org.zkoss.xel.fn.CommonFns</function-class>
		<function-signature>java.lang.Object new_(java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object)</function-signature>
		<description>
	Instantiates the specified class and three arguments.
	The first parameter could be either a string (class name) or a Class instance.
	The second parameter is the first argument passed to the constructor.
	The third parameter is the second argument passed to the constructor.
	The fourth parameter is the third argument passed to the constructor.
		</description>
	</function>

	<function>
		<name>property</name><!-- since 3.5.1 -->
		<function-class>org.zkoss.lang.Library</function-class>
		<function-signature>java.lang.String getProperty(java.lang.String)</function-signature>
		<description>
	Returns the library property.
		</description>
	</function>

	<!--                  -->
	<!-- String Utilities -->
	<!--                  -->
	<function>
		<name>eatQuot</name>
		<function-class>org.zkoss.xel.fn.StringFns</function-class>
		<function-signature>
	java.lang.String eatQuot(java.lang.String)
		</function-signature>
		<description>
	Eliminates single and double quotations to avoid JavaScript injection.
		</description>
	</function>
	<function>
		<name>cat</name>
		<function-class>org.zkoss.xel.fn.StringFns</function-class>
		<function-signature>
	java.lang.String cat(java.lang.Object, java.lang.Object)
		</function-signature>
		<description>
	Catenates two objects. Note: null is considered as empty.
		</description>
	</function>
	<function>
		<name>cat3</name>
		<function-class>org.zkoss.xel.fn.StringFns</function-class>
		<function-signature>
	java.lang.String cat3(java.lang.Object, java.lang.Object, java.lang.Object)
		</function-signature>
		<description>
	Catenates three objects. Note: null is considered as empty.
		</description>
	</function>
	<function>
		<name>cat4</name>
		<function-class>org.zkoss.xel.fn.StringFns</function-class>
		<function-signature>
	java.lang.String cat4(java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object)
		</function-signature>
		<description>
	Catenates four objects. Note: null is considered as empty.
		</description>
	</function>
	<function>
		<name>cat5</name>
		<function-class>org.zkoss.xel.fn.StringFns</function-class>
		<function-signature>
	java.lang.String cat5(java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object)
		</function-signature>
		<description>
	Catenates five objects. Note: null is considered as empty.
		</description>
	</function>
	<function>
		<name>replace</name>
		<function-class>org.zkoss.xel.fn.StringFns</function-class>
		<function-signature>
	java.lang.String replace(java.lang.String, java.lang.String, java.lang.String)
		</function-signature>
		<description>
	Replaces all occurenances of the second argument with the third argument.
		</description>
	</function>
	<function>
		<name>toLowerCase</name>
		<function-class>org.zkoss.xel.fn.StringFns</function-class>
		<function-signature>
	java.lang.String toLowerCase(java.lang.String)
		</function-signature>
		<description>
	Converts to the lower case.
		</description>
	</function>
	<function>
		<name>toUpperCase</name>
		<function-class>org.zkoss.xel.fn.StringFns</function-class>
		<function-signature>
	java.lang.String toUpperCase(java.lang.String)
		</function-signature>
		<description>
	Converts to the upper case.
		</description>
	</function>
	<function>
		<name>trim</name>
		<function-class>org.zkoss.xel.fn.StringFns</function-class>
		<function-signature>
	java.lang.String trim(java.lang.String)
		</function-signature>
		<description>
	Trims the whitespaces.
		</description>
	</function>
	<function>
		<name>split</name>
		<function-class>org.zkoss.xel.fn.StringFns</function-class>
		<function-signature>
	java.lang.String[] split(java.lang.String, java.lang.String)
		</function-signature>
		<description>
	Splits a string into an array of strings based on the given separator.
		</description>
	</function>
	<function>
		<name>join</name>
		<function-class>org.zkoss.xel.fn.StringFns</function-class>
		<function-signature>
	java.lang.String join(java.lang.Object[], java.lang.String)
		</function-signature>
		<description>
	Joins an array of strings into a single string based on the given separator.
		</description>
	</function>
	<function>
		<name>startsWith</name>
		<function-class>org.zkoss.xel.fn.StringFns</function-class>
		<function-signature>
	boolean startsWith(java.lang.String, java.lang.String)
		</function-signature>
		<description>
	Returns whether a string starts with another.
		</description>
	</function>
	<function>
		<name>endsWith</name>
		<function-class>org.zkoss.xel.fn.StringFns</function-class>
		<function-signature>
	boolean endsWith(java.lang.String, java.lang.String)
		</function-signature>
		<description>
	Returns whether a string starts with another.
		</description>
	</function>
	<function>
		<name>substring</name>
		<function-class>org.zkoss.xel.fn.StringFns</function-class>
		<function-signature>
	java.lang.String substring(java.lang.String, int from, int to)
		</function-signature>
		<description>
	Returns the substring.
		</description>
	</function>

	<function>
		<name>indexOf</name>
		<function-class>org.zkoss.xel.fn.CommonFns</function-class>
		<function-signature>
	int indexOf(java.lang.Object, java.lang.Object)
		</function-signature>
		<description>
	Returns the index of the given element.
		</description>
	</function>
	<function>
		<name>lastIndexOf</name>
		<function-class>org.zkoss.xel.fn.CommonFns</function-class>
		<function-signature>
	int lastIndexOf(java.lang.Object, java.lang.Object)
		</function-signature>
		<description>
	Returns the index of the given element.
		</description>
	</function>

	<function>
		<name>l</name>
		<function-class>org.zkoss.xel.fn.CommonFns</function-class>
		<function-signature>java.lang.String getLabel(java.lang.String)</function-signature>
		<description>
		Returns the label of the specified key.
		</description>
	</function>
	<function>
		<name>l2</name>
		<function-class>org.zkoss.xel.fn.CommonFns</function-class>
		<function-signature>java.lang.String getLabel(java.lang.String, java.lang.Object[])</function-signature>
		<description>
		Returns the label of the specified key, and formats with the specified
		argument.
		</description>
	</function>

	<!--                    -->
	<!-- Date Utilities     -->
	<!--                    -->
	<function>
		<name>formatDate</name>
		<function-class>org.zkoss.xel.fn.CommonFns</function-class>
		<function-signature>java.lang.String formatDate(java.util.Date, java.lang.String)</function-signature>
		<description>
		Returns the formatted time string.
		</description>
	</function>
	<function>
		<name>parseDate</name>
		<function-class>org.zkoss.xel.fn.CommonFns</function-class>
		<function-signature>java.util.Date parseDate(java.lang.String, java.lang.String)</function-signature>
		<description>
		Returns A Date parsed from the string.
		</description>
	</function>

	<!--                    -->
	<!-- Number Utilities   -->
	<!--                    -->
	<function>
		<name>formatNumber</name>
		<function-class>org.zkoss.xel.fn.CommonFns</function-class>
		<function-signature>java.lang.String formatNumber(java.lang.Object, java.lang.String)</function-signature>
		<description>
		Returns the formatted number string.
		</description>
	</function>
	<function>
		<name>parseNumber</name>
		<function-class>org.zkoss.xel.fn.CommonFns</function-class>
		<function-signature>java.lang.Number parseNumber(java.lang.String, java.lang.String)</function-signature>
		<description>
		Returns A Number parsed from the string.
		</description>
	</function>
	
	<!--                    -->
	<!-- XML/HTML Utilities -->
	<!--                    -->
	<function>
		<name>attr</name>
		<function-class>org.zkoss.xel.fn.XmlFns</function-class>
		<function-signature>
	java.lang.String attr(java.lang.String, java.lang.Object)
		</function-signature>
		<description>
	Generates an attribute for HTML/XML, name="value".
	If value is null or empty (if String), "" is generated.
		</description>
	</function>

	<!--                -->
	<!-- HTTP Utilities -->
	<!--                -->
	<function>
		<name>encodeURL</name>
		<function-class>org.zkoss.web.fn.ServletFns</function-class>
		<function-signature>
	java.lang.String encodeURL(java.lang.String)
		</function-signature>
		<description>
	Encoding URL to prefix the context path and to provide session info,
	if necessary
	If URI contains "*", it is resolved to the current Locale and
	the browser code.
		</description>
	</function>
	<function>
		<name>encodeURIComponent</name>
		<function-class>org.zkoss.web.servlet.http.Encodes</function-class>
		<function-signature>
	java.lang.String encodeURIComponent(java.lang.String)
		</function-signature>
		<description>
	Encoding a string to be used as a query name or value.
		</description>
	</function>
	<function>
		<name>encodeThemeURL</name>
		<function-class>org.zkoss.web.fn.ServletFns</function-class>
		<function-signature>
	java.lang.String encodeThemeURL(java.lang.String)
		</function-signature>
		<description>
	Encoding URL to theme specific prefix the context path and to provide 
	session info, if necessary
	If URL contains "*", it is resolved to the current Locale and
	the browser code.
		</description>
	</function>
	<function>
		<name>resolveThemeURL</name>
		<function-class>org.zkoss.web.fn.ServletFns</function-class>
		<function-signature>
	java.lang.String resolveThemeURL(java.lang.String)
		</function-signature>
		<description>
		Resolves a URL to point to resource served by the current theme.
		</description>
	</function>

	<function>
		<name>escapeXML</name>
		<function-class>org.zkoss.xml.XMLs</function-class>
		<function-signature>
	java.lang.String escapeXML(java.lang.String)
		</function-signature>
		<description>
	Encodes a string that special characters are quoted to be compatible
	with HTML/XML.
		</description>
	</function>
	
	<function>
		<name>render</name>
		<function-class>org.zkoss.web.fn.ServletFns</function-class>
		<function-signature>
	void render(org.zkoss.web.servlet.dsp.action.ActionContext)
		</function-signature>
		<description>
	Renders a DSP fragment.
		</description>
	</function>

	<function>
		<name>getCurrentLocale</name>
		<function-class>org.zkoss.util.Locales</function-class>
		<function-signature>
	java.util.Locale getCurrent()
		</function-signature>
		<description>
	Returns the locale for the current request.
		</description>
	</function>
	<function>
		<name>testCurrentLocale</name>
		<function-class>org.zkoss.util.Locales</function-class>
		<function-signature>
	boolean testCurrent(java.lang.String, java.lang.String)
		</function-signature>
		<description>
	Returns whether the current locale belongs to the specified
	language and/or country.

	@param lang the language code, e.g., en and zh. Ignored if null.
	@param country the country code, e.g., US. Ignored if null.
		If empty, it means no country code at all.
		</description>
	</function>
</taglib>
