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

ANY Content Elements

ANY Content Elements

The ANY content element accepts any content in an XML file. When you declare an ANY content element in a schema, you can substitute it for an element of any name and type in an XML instance document. The substitute element must exist in the schema.
When you specify ANY content, you use the keyword ANY instead of an element name and element type.
The following schema describes a person with a first name, last name, and an element that is ANY content:
<xs:element name="person">    <xs:complexType>    <xs:sequence>       <xs:element name="firstname" type="xs:string"/>       <xs:element name="lastname" type="xs:string"/>       
<xs:any minOccurs="0"/>
   </xs:sequence>    </xs:complexType> </xs:element>
<xs:element name="son" type="xs:string"/>
<xs:element name=”daughter” type="xs:string"/>
The schema includes a son element and a daughter element. You can substitute the ANY element for the son or daughter element in the XML instance document:
<person>    <firstname>Danny</firstname>    <lastname>Russell</lastname>    
<son>Atlee</son>
</person> <person>    <firstname>Christine</firstname>    <lastname>Slade</lastname>    
<daughter>Susie</daughter>
</person>

0 COMMENTS

We’d like to hear from you!