| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Would it be better to pass in the expected root element? It doesn't make sense that if you call Workbook("foo.tds") we wouldn't give a meaningful error. It would fail, but not with a meaningful error message. |
Sorry, something went wrong.
|
The only way to know would be to force the user to explicitly say a Workbook should be a 'workbook', which feels redundant, or go back to checking the file extension -- which I can add, and it would actually let us optimize not opening every single file in the zip, and only open *.tds *.twb files |
Sorry, something went wrong.
(Not final approach, just want feedback) (Also trying the github in web editor, so this was added blind)
|
I think I've gotta scrap this approach and take a step back. With the commit in its current state you can't rename a twbx to a tdsx and have it work, but you can load Workbook(TDSX_FILE) because all the xfile stuff doesn't have context for what root tag to look for. I can plumb that through, not sure how it feels yet. |
Sorry, something went wrong.
|
@RussTheAerialist I think you should move open_xml into xfile and then we can ignore this bug for 0.2. Then we can chat about a cleaner approach to making sure Workbook is actually getting a workbook file |
Sorry, something went wrong.
|
I'm okay with that. My thought was that when you invoked it from Workbook or Datasource, you would just put in the root tag you expected. That way xfile remains generic and uncoupled to the concept of Workbook/Datasource, and workbook/datasource can specify the root tag to check (and only check if specified), same for file extension, I suppose. |
Sorry, something went wrong.
|
Yeah, I like the idea of xml_open passing that argument, once you merge it I'll rebase and give it a go (I've got a long flight anyway) |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Previously it was opening any valid xml file, despite supposedly checking for the right root tag.
Now we actually check for the root tag to see if it's in the whitelist.