Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-9832

XMLReader: XML element's content disappears if the element has attribute

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.17.0, 1.16.1
    • Extensions

    Description

      Let's use a ConvertRecord processor with an XMLReader and an XMLRecordSetWriter to process XML documents.

      XMLReader controller service settings:

      • Schema Access Strategy: Infer Schema
      • Expect Records as Array: false

      XMLRecordSetWriter controller service settings:

      • Schema Access Strategy: Inherit Record Schema

      ConvertRecord processor settings:

      • Record Reader: XMLReader
      • Record Writer: XMLRecordSetWriter

      Input data:

      <record>
        <num>123</num>
        <software favorite="true">Apache NiFi</software>
      </record> 

      Output:

      <record>
        <num>123</num>
        <software>
          <favorite>true</favorite>
          <value></value>
        </software>
        <favorite></favorite>
      </record> 

      The value "Apache NiFi" is lost.

      (The issue of the additional "favorite" xml element is covered in https://issues.apache.org/jira/browse/NIFI-9831)

      Attachments

        Issue Links

          Activity

            People

              pgyori Peter Gyori
              pgyori Peter Gyori
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 3h 50m
                  3h 50m