Uploaded image for project: 'Teiid Designer'
  1. Teiid Designer
  2. TEIIDDES-1060

Incorrect Transformation when using 'Create XML to Scalar Transformation' in Teiid Designer

    XMLWordPrintable

Details

    • Bug
    • Resolution: Obsolete
    • Major
    • None
    • 7.1.1
    • Transformations
    • None
    • Hide

      create a virtual layer using an XSD.
      1. Create new Teiid Project.
      2. Import the XSD using the 'Import/XML Schemas" dialogue.
      3. Create a skeleton Relational View Model.
      4. Open up the XSD from step 2 in the Eclipse XML Editor.
      5. Right-click on the one element (in this case students).
      6. Select Modeling/Create XML to Scalar Transformation
      7. Select the Relational View Model created in Step 3.
      8. Update imports and modify datatypes as required
      9. There are now 5 extract_* functions: extract_student, extract_health, extract_nonCitizen, extract_citizenCountry, extract_birthCountry
      10. Open up the Transformation View for any extract_* function. For example, the extract_student.

      The transformation for this is generated as follows:
      CREATE VIRTUAL PROCEDURE
      BEGIN
      SELECT t.* FROM XMLTABLE(XMLNAMESPACES(DEFAULT ''), '/students/student/barReview/studentRep/health/nonCitizen' PASSING STUDENTVIEWEXTRACT.STUDENTS.EXTRACT_STUDENT.xml_in COLUMNS headRep boolean, abaNumber string) AS t;
      END

      First things to notice: the namespace is empty and the XQuery is incorrect. Upon inspection of the sample.xml file, one will notice that <student> is the second element. Additionally, the root element is using a namespace. In this instance, the root element is actually <pty:students>. And, the XQuery that is generated, points to nothing. Specifically, barReview, health, and nonCitizen are all at the same level within the document.

      Show
      create a virtual layer using an XSD. 1. Create new Teiid Project. 2. Import the XSD using the 'Import/XML Schemas" dialogue. 3. Create a skeleton Relational View Model. 4. Open up the XSD from step 2 in the Eclipse XML Editor. 5. Right-click on the one element (in this case students). 6. Select Modeling/Create XML to Scalar Transformation 7. Select the Relational View Model created in Step 3. 8. Update imports and modify datatypes as required 9. There are now 5 extract_* functions: extract_student, extract_health, extract_nonCitizen, extract_citizenCountry, extract_birthCountry 10. Open up the Transformation View for any extract_* function. For example, the extract_student. The transformation for this is generated as follows: CREATE VIRTUAL PROCEDURE BEGIN SELECT t.* FROM XMLTABLE(XMLNAMESPACES(DEFAULT ''), '/students/student/barReview/studentRep/health/nonCitizen' PASSING STUDENTVIEWEXTRACT.STUDENTS.EXTRACT_STUDENT.xml_in COLUMNS headRep boolean, abaNumber string) AS t; END First things to notice: the namespace is empty and the XQuery is incorrect. Upon inspection of the sample.xml file, one will notice that <student> is the second element. Additionally, the root element is using a namespace. In this instance, the root element is actually <pty:students>. And, the XQuery that is generated, points to nothing. Specifically, barReview, health, and nonCitizen are all at the same level within the document.

    Description

      Incorrect Transformation when using 'Create XML to Scalar Transformation' in Teiid Designer. See Steps to reproduce section for full description.

      Attachments

        Issue Links

          Activity

            People

              rhn-engineering-tejones Edwin Jones
              rhn-support-dsteigner Deborah Steigner (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: