BiXsTypeConverter
This class contains static methods that converts XML Schema types to Javascript types as well as converting strings formatted according to the XML Schema to Javascript values.
The following type relations are used
XS type name - JS type name - JS class "negativeInteger" - "number" - Number "unsignedShort" - "number" - Number "unsignedByte" - "number" - Number "unsignedLong" - "number" - Number "unsignedInt" - "number" - Number "decimal" - "number" - Number "boolean" - "number" - Number "integer" - "number" - Number "double" - "number" - Number "float" - "number" - Number "short" - "number" - Number "byte" - "number" - Number "long" - "number" - Number "int" - "number" - Number "QName" - "string" - String "string" - "string" - String "normalizedString" - "string" - String "dateTime" - "date" - Date "date" - "date" - Date "time" - "date" - Date
This class extends BiObject and therefore all methods and fields available for BiObject are also available for BiXsTypeConverter .
Constructor
new BiXsTypeConverter ( )
Parameters
No parameters.
Properties
None.
Methods
None.
Events
None.
Static Methods
| Name | Description |
decodeIsoDate | Takes a string formatted according to the XML Schema data type (this is the ISO standard format). |
decodeIsoDateTime | Takes a string formatted according to the XML Schema datatime type (this is the ISO standard format). Example: YYYY-MM-DDThh:mm:ss.sTZD (eg 1997-07-16T19:20:30.45+01:00) |
decodeIsoTime | Takes a string formatted according to the XML Schema time type (this is the ISO standard format). |
getJsType | Takes the XML Schema type name and returns the Javacsript type (class, constructor). For example if you pass "time" you will get Date as the result. |
getJsTypeName | Takes the XML Schema type name and returns the Javacsript type name. For example if you pass "time" you will get "date" as the result. |
getJsValue | This takes a string and an XML schema type representing a value and then converts this string to the correct Javascript value. |
Static Fields
None.
Remarks
None.
Static Method Details
decodeIsoDate
Takes a string formatted according to the XML Schema data type (this is the ISO standard format).
Syntax
BiXsTypeConverter . decodeIsoDate ( s ) Parameters
| Name | Type | Optional | Default | Descripton |
s | String | The string representing the ISO date. |
Return Type
Data
decodeIsoDateTime
Takes a string formatted according to the XML Schema datatime type (this is the ISO standard format).
Example: YYYY-MM-DDThh:mm:ss.sTZD (eg 1997-07-16T19:20:30.45+01:00)
Syntax
BiXsTypeConverter . decodeIsoDateTime ( s ) Parameters
| Name | Type | Optional | Default | Descripton |
s | String | The string representing the ISO date time. |
Return Type
Date
decodeIsoTime
Takes a string formatted according to the XML Schema time type (this is the ISO standard format).
Syntax
BiXsTypeConverter . decodeIsoTime ( s ) Parameters
| Name | Type | Optional | Default | Descripton |
s | String | The string representing the ISO date time. |
Return Type
Date
getJsType
Takes the XML Schema type name and returns the Javacsript type (class, constructor). For example if you pass "time" you will get Date as the result.
Syntax
BiXsTypeConverter . getJsType ( sXsType ) Parameters
| Name | Type | Optional | Default | Descripton |
sXsType | String | The XML Schema type name |
Return Type
Function
getJsTypeName
Takes the XML Schema type name and returns the Javacsript type name. For example if you pass "time" you will get "date" as the result.
Syntax
BiXsTypeConverter . getJsTypeName ( sXsType ) Parameters
| Name | Type | Optional | Default | Descripton |
sXsType | String | The XML Schema type name |
Return Type
String
getJsValue
This takes a string and an XML schema type representing a value and then converts this string to the correct Javascript value.
Syntax
BiXsTypeConverter . getJsValue ( sValue,sXsType ) Parameters
| Name | Type | Optional | Default | Descripton |
sValue | String | A string describing the value expressed using the correct syntax according to the schema | ||
sXsType | String | The XML schema type name |
Return Type
Object