That’s a cool way of handling this problem but not very useful in my case as the XML documents I work with are not a standard structure that you know about ahead of time. Is there any plans to add in wildcard support for variable sections of a document?
Interesting problem, technically it can handle that I think! Under the hood it just uses xpath queries (I need to make this more obvious in the docs!) So you could just have a path of '//fourth'
It would be cool if you could just slap one attribute on the top-level class and have it be able to automatically infer the fields where the name matches
11 comments
After dealing with some nasty associative arrays built from XML, I decided enough was enough!
Documentation still needs some work, and I would like to introduce JSONpath eventually so we can also handle JSON!
This is nice, i've been looking for something just like this. Thank!
That’s a cool way of handling this problem but not very useful in my case as the XML documents I work with are not a standard structure that you know about ahead of time. Is there any plans to add in wildcard support for variable sections of a document?
Example #[STR(‘/first/second/*/fourth’)]
Interesting problem, technically it can handle that I think! Under the hood it just uses xpath queries (I need to make this more obvious in the docs!) So you could just have a path of '//fourth'
That's what I came to ask. Really nice that it uses xpath.
Do we have any benchmarks for this vs manual assignment after decoding in case of memory and time?
Currently, no, although I'm very much aware this can be an issue.
I'll look at benchmarking it and publishing the results, hopefully sometime this week.
It would be cool if you could just slap one attribute on the top-level class and have it be able to automatically infer the fields where the name matches
That's not a bad idea. Wouldn't be able to get values from attributes, but could definitely use it to fill out properties by node values!
I'll knock together a draft to see what it would look like!
Awesome idea, looks super useful!
Deleted before we saved it.