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

Troubleshooting XML Targets

Troubleshooting XML Targets

I imported a source definition from an XML file. Then I imported a target definition from the same XML file. The default groups for the source and target definitions are not the same.
The XML Wizard does not always create the same group structure for a source definition and a target definition if you change some of the options when you import the target.
For example, the ContactInfo element in the following DTD is an enclosure element. The enclosure element has no text content, but has maxOccurs > 1. The child elements also have maxOccurs > 1.
<!ELEMENT HR (EMPLOYEE+)> <!ELEMENT EMPLOYEE (LASTNAME,FIRSTNAME,ADDRESS+,CONTACTINFO+)> <!ATTLIST EMPLOYEE EMPID CDATA #REQUIRED> <!ELEMENT LASTNAME (#PCDATA)> <!ELEMENT FIRSTNAME (#PCDATA)> <!ELEMENT ADDRESS (STREETADDRESS,CITY,STATE,ZIP)> <!ELEMENT STREETADDRESS (#PCDATA)> <!ELEMENT CITY (#PCDATA)> <!ELEMENT STATE (#PCDATA)> <!ELEMENT ZIP (#PCDATA)> <!ELEMENT CONTACTINFO (PHONE+,EMERGCONTACT+)> <!ELEMENT PHONE (#PCDATA)> <!ELEMENT EMERGCONTACT (#PCDATA)>
If you do not create XML views for the enclosure elements in the source definition, you do not create the ContactInfo element in the source.
The following figure shows the source and target definitions that the XML Wizard creates:
The source definition does not include the ContactInfo element. The target definition includes the ContactInfo element. The wizard does not include the ContactInfo element in the source definition because you chose not to create views for enclosure elements when you created the source. However, the wizard includes the ContactInfo element in the target definition.
The XML target definition I created from my relational sources contains all elements, but no attributes. How can I modify the target hierarchy so that I can mark certain data as attributes?
You cannot modify the component types that the wizard creates from relational tables. However, you can view a DTD or an XML schema file of the target XML hierarchy. Save the DTD or XML schema file with a new file name. Open this new file and modify the hierarchy, setting the attributes and elements. Then, use the file to import a target definition with a new hierarchy.

0 COMMENTS

We’d like to hear from you!