RXSD icon indicating copy to clipboard operation
RXSD copied to clipboard

Can RXSD generate schema-complaint XML?

Open mikegee opened this issue 10 years ago • 2 comments

If I parse an XSD into Ruby classes and create instances of those classes. Do those instances know how to serialize themselves into XML that is guaranteed to validate against the XSD?

I don't see an example of this use case in the readme or from a cursory scan of the implementation.

mikegee avatar Jul 17 '14 20:07 mikegee

@mikegee hey it's been a while but do recall that as it stands rxsd will only allow you to go from xml/xsd -> ruby and not the other way. The reverse is still on the TODO list but as mentioned in #14 I probably won't have any time to dedicate to improving RXSD in the forseeable future. If you have any more questions or would like to add anymore enhancements though, I'd be glad to help.

Thanks for reaching out, -Mo

movitto avatar Aug 03 '14 18:08 movitto

@movitto no worries. We ended up writing a bunch of classes with HappyMapper. It's kinda tedious, and HappyMapper doesn't know about the xsd, so we have to validate everything we generate, but it's DSL is very straightforward. I'm thinking about a new tool (or a big change to rsxd) that just reads an xsd and makes HappyMapper classes. Unfortunately, I don't know xsds very well, so that would be a significant undertaking.

Thanks for your work on rsxd and for answering my question.

mikegee avatar Aug 03 '14 22:08 mikegee