Hi,
Could you, please, tell what can be wrong here.
This query works:
db:open("IntersectPhoneNumbers","Data/rent_flats.csv")/csv/record/UserPhone
With result:
<UserPhone>2218520</UserPhone> <UserPhone>2219391</UserPhone> <UserPhone>2348039</UserPhone> ...
I can access the file directly from the query, without adding it into a database. This also does work, giving the same result:
let $csv := file:read-text(fn:resolve-uri('Data/rent_flats.csv')) let $rent_flats := csv:parse($csv, { 'header': true(), 'separator': 'tab' }) return $rent_flats/csv/record/UserPhone
But this does not work:
doc("Data/rent_flats.csv")/csv/record/UserPhone
Error: [FODC0002] "C:/Projects/IntersectPhoneNumbers/Data/rent_flats.csv" (Line 1): Content is not allowed in prolog.
Though I can browse the file from BaseX GUI. It is in DB. Selecting nodes in Folder Pane for that file, shows the actual data in Result Pane.
I can also access all records from all files in Data folder, including rent_flats.csv:
/csv/record/UserPhone
But I wish to refer to rent_flats.csv only.
Why is this error? I am using BaseX 7.9 on Windows XP SP3.
-- Roman