Added example to loadXML taken from p5.xml.js #2002
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi all,
This is a partial (and I hope, temporary) fix for issue #1954. Specifically, it adds an example for loadXML.
This example is taken directly from io/p5.xml.js.
I've been working on this for a few days, and wanted to get something submitted.
I've actually written a number of examples of loadXML calls (both invoked inside preload and with a callback), but I've had real trouble getting them to work locally inside the p5.js-website framework.
It's possible I'm building the documentation incorrectly, but every other example that doesn't use loadXML seems to run just fine (I'm getting this weird error where the parseXML function isn't being found, but the examples run just fine if I run them outside of the docs).
It's my suspicion that this is why the only loadXML example we do have is invoked with the "norender" class, and why the documentation for loadXML itself mentions the existence of an example, even though there is no example to be had.
So I hope this will do for the moment, I'm going to try dig into the parseXML issue a little more, and if I can't work out what's going on I'll open a separate issue for that.
Thanks :)