Description
--xml-root and --xml-row flags were only used for XML output formatting. The call to loadXmlInput(), getXmlColumnNames(), and summarizeXml() never received these values, so they were silently ignored when parsing XML input.
Impact
Commands like the following produced wrong results or SQL errors instead of working as expected:
curl -s "https://feeds.feedburner.com/TheHackersNews" \
| sql-pipe -I xml --xml-root channel --xml-row item \
'SELECT pubDate, title FROM t WHERE title LIKE "%Google%" LIMIT 5'
The parser would read <rss> as root, treat <channel> as the only row, and fail with no such column: pubDate because the actual item fields were nested one level deeper.
Root cause
loadXmlInput() (and the two related functions) had no xml_root / xml_row parameters, so the values parsed from the CLI were dropped before parsing started.
Acceptance Criteria
Description
--xml-rootand--xml-rowflags were only used for XML output formatting. The call toloadXmlInput(),getXmlColumnNames(), andsummarizeXml()never received these values, so they were silently ignored when parsing XML input.Impact
Commands like the following produced wrong results or SQL errors instead of working as expected:
The parser would read
<rss>as root, treat<channel>as the only row, and fail withno such column: pubDatebecause the actual item fields were nested one level deeper.Root cause
loadXmlInput()(and the two related functions) had noxml_root/xml_rowparameters, so the values parsed from the CLI were dropped before parsing started.Acceptance Criteria
--xml-root <tag>navigates to that element in the document before iterating rows--xml-row <tag>filters direct children of the container to only those with a matching tag--columnsand--validatemodes respect the flags for XML input as well