Lehel44 commented on code in PR #5964:
URL: https://github.com/apache/nifi/pull/5964#discussion_r850538613


##########
nifi-nar-bundles/nifi-standard-services/nifi-record-serialization-services-bundle/nifi-record-serialization-services/src/main/java/org/apache/nifi/xml/XMLRecordReader.java:
##########
@@ -509,6 +477,53 @@ private Record parseRecord(StartElement startElement, 
RecordSchema schema, boole
         }
     }
 
+    private void parseAttributesForRecord(StartElement startElement, 
RecordSchema schema, boolean coerceTypes, boolean dropUnknown, Map<String, 
Object> recordValues) {
+        final Iterator iterator = startElement.getAttributes();
+        while (iterator.hasNext()) {
+            final Attribute attribute = (Attribute) iterator.next();
+            final String attributeName = attribute.getName().toString();
+
+            final String targetFieldName = attributePrefix == null ? 
attributeName : attributePrefix + attributeName;
+
+            if (dropUnknown) {
+                final Optional<RecordField> field = 
schema.getField(attributeName);
+                if (field.isPresent()){
+
+                    // dropUnknown == true && coerceTypes == true

Review Comment:
   Are the comments here intentional?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to