Table of Contents

Search

  1. Preface
  2. XML Concepts
  3. Using XML with PowerCenter
  4. Working with XML Sources
  5. Using the XML Editor
  6. Working with XML Targets
  7. XML Source Qualifier Transformation
  8. Midstream XML Transformations
  9. XML Datatype Reference
  10. XPath Query Functions Reference

XML Guide

XML Guide

anyType Elements

anyType Elements

An anyType element can be any datatype in an XML instance document. Declare an element to be anyType when the element contains different types of data.
The following schema describes a person with a first name, last name, and an age element that is anyType:
<xs:element name="person">    <xs:complexType>    <xs:sequence>       <xs:element name="firstname" type="xs:string"/>       <xs:element name="lastname" type="xs:string"/>       <<
xs:element name="age" type="xs:anyType"/
>    </xs:sequence>    </xs:complexType> </xs:element>
The following XML instance document includes a date type and a number in the age element:
<person>    <firstname>Danny</firstname>    <lastname>Russell</lastname>    
<age>1959-03-03</age>
</person> <person>    <firstname>Carla</firstname>    <lastname>Havers</lastname>    
<age>46</age>
</person>
Both types are valid for the schema. If you do not declare a datatype for an element in a schema, the element defaults to anyType when you import the schema in the Designer.

0 COMMENTS

We’d like to hear from you!