IBM Integration Bus, Version 9.0.0.8 Operating Systems: AIX, HP-Itanium, Linux, Solaris, Windows, z/OS

See information about the latest product version

Cast type (xs:type)

You can use an xs:type transform to cast the value of a simple element to a specific data type.

Overview

For example, you might want to assign a value with a specific data type to a target element that is defined as xs:anySimpleType.

When you use an xs:type transform, you can have zero or more input elements mapped to the transform, but only a single output element. You can cast one value to set the output element. This value is set in the Value column of theGeneral tab on the Properties page. The value can be one of the following entities:
  • A literal value
  • A single input value
  • An XPath expression that uses zero or more of the input values

You can also use any of the input elements to build an XPath conditional expression that determines whether the xs:type transform is applied or not. You set this conditional expression on the Condition tab of the Properties page.

You must choose the xs:type transform according to the output element data type. For example, if you have an output element with a boolean data type, you must choose xs:boolean transform.

For more information about casting a specific value type to an output element, see Setting the value of an output element with a explicit data type.

Assign a value

You can set a fixed value or define an XPath expression in the Value field located in the General tab of a xs:type transform properties view.

This figure shows the general tab in the Properties view for the Assign transform.

To define an XPath expression, you click Edit. Then, you can use content-assist to enter the expression. As part of the expression, you can use any input elements for which you have defined connections to the transform.

Define a conditional expression

You can define multiple connections between input elements and an xs:type transform. You can then use these input elements in a conditional expression that defines the condition under which the transform should be applied. If the condition evaluates to true, the transform is applied.

When you define multiple input connections, you can configure the following properties to define how those inputs are displayed in the message map:
  • Sort: You can sort the inputs to the transform by ascending order, descending order, case order, or data order.
  • Order: You can display the order of input connections to a transform. You can reorder them.

For more information on how to configure these properties, see Configuring a mapping transform properties.

xs:type transforms

You can use any of the following xs:any transforms:
  • xs:NOTATION: This function takes a primitive and casts it as notation.
  • xs:Qname: This function takes a primitive and casts it as Qname.
  • xs:anyURI: This function takes a primitive and casts it as anyURI.
  • xs:base64Binary: This function takes a primitive and casts it as base64Binary.
  • xs:boolean: This function takes a primitive and casts it as boolean.

    You can use any of the following values: true or false.

  • xs:dateTime: This function takes a primitive and casts it as dateTime.
  • xs:date: This function takes a primitive and casts it as date.
  • xs:dayTimeDuration: This function takes a primitive and casts it as dayTimeduration.
  • xs:decimal: This function takes a primitive and casts it as decimal.
  • xs:double: This function takes a primitive and casts it as double.
  • xs:float: This function takes a primitive and casts it as float.
  • xs:gDay: This function takes a primitive and casts it as gDay.
  • xs:gMonthDay: This function takes a primitive and casts it as gMonthDay.
  • xs:gMonth: This function takes a primitive and casts it as gMonth.
  • xs:gYearMonth: This function takes a primitive and casts it as gYearMonth.
  • xs:gYear: This function takes a primitive and casts it as gYear.
  • xs:hexBinary: This function takes a primitive and casts it as hexBinary.
  • xs:integer: This function takes a primitive and casts it as integer.
  • xs:int: This function takes a primitive and casts it as signed 32-bit integer.
  • xs:string: This function takes a primitive and casts it as string.
  • xs:time: This function takes a primitive and casts it as time.
  • xs:yearMonthDuration: This function takes a primitive and casts it as yearMonthDuration.

cm28657_.htm | Last updated Friday, 21 July 2017