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 Sources

Troubleshooting XML Sources

How can I put two multiple-occurring elements that both have the same parent element into one view? For example, I need to put all the elements of EMPLOYEE in one view:
<!ELEMENT EMPLOYEE (EID, EMAIL+, PHONE+)>
EMAIL and PHONE belong to the same parent element, but they do not belong to the same parent chain. You cannot put them in the same denormalized view. To put all the elements of employee in one view, you can pivot one of the multiple occurring elements.
Follow these steps to add two multiple-occurring elements to the same view:
  1. Create an EMPLOYEE view.
  2. Add the EID and EMAIL elements to the EMPLOYEE view.
  3. Pivot the number of occurrences of EMAIL that you want to include in the view. Each EMAIL occurrence becomes a single occurring element in the view.
  4. Add the PHONE element.
    I have the following element definition in my DTD:
    <!ELEMENT EMPLOYEE (EMPNO, SALARY)+>
    How can I match the EMPNO and SALARY in the same view?
The DTD example is ambiguous. The definition is equivalent to the following:
<!ELEMENT EMPLOYEE (EMPNO+, SALARY+)>
In the DTD example, EMPLOYEE has multiple-occurring elements EMPNO and SALARY. You cannot have two multiple-occurring elements in the same view.
Use one of the following solutions:
  • Rewrite the element definition to make the definition unambiguous.
    You might define the EMPLOYEE element as follows:
    <!ELEMENT EMPLOYEES (EMPLOYEE+)> <!ELEMENT EMPLOYEE (EMPNO, SALARY)>
    When you use this syntax, you define one EMPNO and one SALARY for each EMPLOYEE. The EMPLOYEE view contains both elements. Include EMPLOYEE as a multiple-occurring element in EMPLOYEES.
  • Leave the elements in separate views and use the source definition twice in a mapping.
    When EMPNO and SALARY are in different views, you can still combine the data in a mapping. Use two instances of the same source definition and use a Joiner transformation.
    I imported an XML file with the following structure:
    <Bookstore> <Book>Book Name</Book> <Book>Book Name</Book> <ISBN>051022906630</ISBN> </Bookstore>
    When I import this XML file, the Designer drops the ISBN element. Why does this happen? How can I get the Designer to include the ISBN element?
  • Use the schema to import the XML definition
    . When you use an XML file to import an XML definition, the Designer reads the first element as simple content because the element has no child elements. The Designer discards the ISBN child element from the second Book instance. If you use a schema to import the definition, the Designer uses the schema definition to determine how to read XML data.
  • Verify the XML file accurately represents the associated schema
    . If you use an XML file to import a source definition, verify the XML file is an accurate representation of the structure in the corresponding XML schema.
For information about XML sizing in PowerCenter, see Using XML with PowerCenter Overview. For information about the limitations that apply to XML handling in PowerCenter, see Limitations.
To create a transformation with other element types, and to transform larger XML input files, use a Data Processor transformation. For more information about how to create Data Processor transformations, see the
Informatica Data Transformation User Guide
and the
Informatica Data Transformation Getting Started Guide
.

0 COMMENTS

We’d like to hear from you!