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. Appendix A: XML Datatype Reference
  10. Appendix B: XPath Query Functions Reference

XML Guide

XML Guide

AnyAttribute Attributes

AnyAttribute Attributes

The anyAttribute attribute accepts any attribute in an XML file. When you declare an attribute as anyAttribute you can substitute the anyAttribute element for any attribute in the schema.
The following schema describes a person with a first name, last name, and an attribute that is anyAttribute:
<xs:element name="person"> <xs:complexType>    <xs:sequence>       <xs:element name="firstname" type="xs:string"/>       <xs:element name="lastname" type="xs:string"/>    </xs:sequence>    
<xs:anyAttribute/>
</xs:complexType> </xs:element>
The following schema includes a gender attribute:
<xs:attribute name="gender">
   <xs:simpleType>    <xs:restriction base="xs:string">    <xs:pattern value="male|female"/>     </xs:restriction> </xs:simpleType> </xs:attribute>
The following XML instance document substitutes anyAttribute with the gender attribute:
<person gender="female">
   <firstname>Anita</firstname>    <lastname>Ficks</lastname> </person>
<person gender="male">
   <firstname>Jim</firstname>    <lastname>Geimer</lastname> </person>

0 COMMENTS

We’d like to hear from you!