Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
Description
From the mailing list:
I have configured a XMLReader to use the Infer Schema. The other issue is that I have problems converting sub records. My records looks something like this:<RootLabel> <Part1> <name>John Doe</name> <adress>some there</adress> </Part1> <Part2> <Job>workingman</Job> </Part2> <Part3> <Details> <additionalInfo name="Location">New York</additionalInfo>
<additionalInfo name="Company">A Company</additionalInfo>
</Details>
</Part3>
</RootLabel>
The issues are with the subrecords in part 3. I have configured the XMLReader property "Field Name for Content" = value
When the data is being converted via a XMLWriter the output for the additionalInfo fields looks like this:
<Part3> <Details> <additionalInfo>MapRecord[\{name=Location, value=New York}]</additionalInfo>
<additionalInfo>MapRecord[\{name=Company, value=A Company}]</additionalInfo> </Details>
</Part3>
If I use a JSONWriter I gets this:
"Part3": { "Details":Unknown macro: { "additionalInfo"}]", "MapRecord[\{name=Company, value=A Company}]" ]
}
}
The issue appears to be that "additionalInfo" is being inferred as a String, but the XML Reader is returning a Record.
This is probably because the "additionalInfo" element contains String content and no child nodes. However, it does have attributes. As a result, the XML Reader will return a Record. I'm guessing that attributes are not taken into account in the schema inference, though, and since "additionalInfo" has no child nodes but has textual content, it must be a String.
Attachments
Issue Links
- links to