I use Excel's XML mapping to download RSS feeds and select elements to display in column. I'm currently using Google Spreadsheet's IMPORTXML functions and trying to recreate my below Excel results.
The site being queried uses XML namespaces for its RSS feed and so
[local-name() = "ELEMENTNAME"] is applied in the query. I'm using the following formula, where "URL" and "ELEMENTNAME" are defined ranges, for each of the eight columns:
=IMPORTXML(URL,CONCATENATE("//*[local-name() = '",*ELEMENTNAME*,"']"))
Without the CONCATENATE function the formulas are:
//*/[local-name() = 'filing-date'] //*/[local-name() = 'size'] etc.
The output is fine except (1) it requires multiple queries for a single URI that (I believe) may slow the workbook as more queries are added and (2) for columns that have null entries in certain rows, such as the last two on the right, the table displays them consecutively from the top-down, i.e. the column results are not in their correct rows.
I also tested using the below query with specific elements selected though the output displays in rows rather than columns and are not organized as listed in the query:
//*[local-name() = 'filing-date'] | //*[local-name() = 'filing-type'] | //*[local-name() = 'filing-href'] | //*[local-name() = 'form-name'] | //*[local-name() = 'size'] | //*[local-name() = 'amend']
Is there a way to consolidate these queries into one and, if the only solution is to keep the queries separate, have the null entries for each element appear as a blank cell?