-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add XPath Notebook Samples #2
Comments
re: https://github.com/DeltaXML/vscode-xpath-notebook/tree/main/samples/notebooks/gdpbycountry I would suggest to forgo Also, if you want to get better GDP data, see this kaggle dataset: https://www.kaggle.com/tunguz/country-regional-and-world-gdp or search for others there. |
I might use that dataset for providing XPath notebook example in my data table renderer extension here: RandomFractals/vscode-data-table#69 |
@pgfearo how do I specify xml data source? I copied your notebook and xml data, and placed them in the same folder: I think docs need an example for this part: https://github.com/DeltaXML/vscode-xpath-notebook#step-3-setup-the-xpath-evaluation-context |
@RandomFractals The XML (or JSON) data source for the XPath Notebook is the most recent (non-notebook) file opened in Visual Studio Code. This should be intuitive to users of popular XML tools such Oxygen XML's XPath Builder View - but perhaps less obvious to others. I will try to make this clearer in the documentation. If this most recent file opened in VS Code was not valid XML or JSON then the data source is empty (i.e. there is no XPath context item) but you can still execute XPath expressions that don't rely on a data source being set as the context. I do intend to add other ways to bind the Notebook to a data source in a transient way. But this requires more advanced Notebook features and will therefore have to wait until Visual Studio Code's Notebook API is fully implemented in the stable release For a more persistent method for binding a data source, the user should probably use the XPath Cell 1
Cell 2
A complication is that prefix/URI bindings for XML namespace are currently only extracted from the XPath Notebook data source... |
@pgfearo I looked at your updated docs and notebook examples. Tried loading xml data again, and still get errors: Could you please provide a clear example of how to load xml data from a file location relative to XBook? Thanks! |
You have followed the example correctly, as you can see in the specification fn:doc. This could either be a bug (most likely) or an issue with the XML data source. The Do you get a similar error for other types of XML data files? Is there hexadecimal content in the XML by any chance? |
that data file is here: https://github.com/RandomFractals/vscode-data-table/blob/main/data/world-gdp.xml It doesn't have hexadecimal content. I was able to load it with fast-xml-parser just fine. Please ignore the data:table JSON.parse errors you see there. Those are coming from my extension, which tries to parse cell output as json first. I could not get it to work with your example files either. so, must be Windows related. |
Ok, I've dusted off my Windows laptop and I can reproduce the issue immediately with even simple expressions like:
This is definitely a windows file path issue. Node.js is not expecting '\' chars without escaping I think. There's a bit of complexity here because JavaScript is being created dynamically to load the compiled XSLT. |
@RandomFractals The error you were getting was specific to Windows and has now been fixed in v0.0.3. I added a new issue: issue #4 |
The text was updated successfully, but these errors were encountered: