zek
zek copied to clipboard
Type inferencing
This would be really nice. If you point me in the right direction, I might be willing to implement.
Quick reply: Thanks for the suggestion, if I had not been too lazy, I would have implemented it already :) The other aspect is that zek allows to operate on XML without schema, which is both nice and fuzzy. Not inferring the type is expressing that fuzziness.
That said, it would be nice - as an optional flag.
Hello guys, any news about this feature? As @mattwilliamson I would be happy to help you implementing it, if you can please point me in the right direction as well. That's my scenario: I am using pyang to convert a yang model to an empty xml data and using a specific flag it will save the type (since it has access to the model/schema) inside the xml as a comment, something like this:
<alarm-state>
<!-- type: boolean -->
</alarm-state>
So for me it would be just a matter of getting access to that comment. Do you have any clue on where I should start from?
@marcodellemarche, thanks for the use case. Not exactly an answer, but I recently saw xsd2go - if you have a schema, this might be a way to go.
I recently saw: https://github.com/twpayne/go-xmlstruct - which implements type inference nicely.