Skip to content
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

Type inferencing #13

Open
mattwilliamson opened this issue Aug 30, 2019 · 4 comments
Open

Type inferencing #13

mattwilliamson opened this issue Aug 30, 2019 · 4 comments

Comments

@mattwilliamson
Copy link

This would be really nice. If you point me in the right direction, I might be willing to implement.

@miku
Copy link
Owner

miku commented Aug 31, 2019

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.

@marcodellemarche
Copy link

marcodellemarche commented Apr 14, 2021

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?

@miku
Copy link
Owner

miku commented Apr 20, 2021

@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.

@miku
Copy link
Owner

miku commented Feb 21, 2023

I recently saw: https://github.com/twpayne/go-xmlstruct - which implements type inference nicely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants