fnogatz / xsd2json

Translate XML Schema into equivalent JSON Schema
MIT License
149 stars 28 forks source link

Validation after conversion #39

Closed rajashekhargundeti closed 8 years ago

rajashekhargundeti commented 8 years ago

Hi,

I need to do xml validation against xsd. i thought of using libxmljs module. i couldn't move forward with it as it has some building/installation issues. Moreover, i haven't found any other module to accomplish the task.

Now, i would like to use xsd2json converter to convert XSD to JSON and XML to JSON and validate it.

Please let me know if there is already a validator for this. or how do you suggest me to go about this.

Thanks, Raja

fnogatz commented 8 years ago

In general it does not seem like the perfect idea to convert both formats first only to execute the validation with JSON and JSON Schema. Both conversions will not be without some loss, and even worse, this xsd2json tool might use other assumptions to translate the schema than some other tool uses to translate the XML file to JSON. I would stick to existing XSD validators.

rajashekhargundeti commented 8 years ago

I dont find anything otherthan libxmljs

On Sat, Jun 11, 2016 at 2:49 AM, Falco Nogatz notifications@github.com wrote:

In general it does not seem like the perfect idea to convert both formats first only to execute the validation with JSON and JSON Schema. Both conversions will not be without some loss, and even worse, this xsd2json tool might use other assumptions to translate the schema than some other tool uses to translate the XML file to JSON. I would stick to existing XSD validators.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/fnogatz/xsd2json/issues/39#issuecomment-225298370, or mute the thread https://github.com/notifications/unsubscribe/ALREpOSQHKDZl7g34faM5xnqVtohKF9Uks5qKdTFgaJpZM4IzAzq .

fnogatz commented 8 years ago

Have a look at the Apache Xerces Project. It is great for validating XML documents against XML Schema.

rajashekhargundeti commented 8 years ago

I think, it is in java, not javascript, right??

On Sat, Jun 11, 2016 at 10:25 AM, Falco Nogatz notifications@github.com wrote:

Have a look at the Apache Xerces Project http://xerces.apache.org/. It is great for validating XML documents against XML Schema.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/fnogatz/xsd2json/issues/39#issuecomment-225336981, or mute the thread https://github.com/notifications/unsubscribe/ALREpH9koTPBETw0bJnBldUVSaU8OFELks5qKj-5gaJpZM4IzAzq .

fnogatz commented 8 years ago

I am not aware of JavaScript validators for XML Schema. Apache Xerces is indeed available for Java and C.

fnogatz commented 8 years ago

I will close here. Feel free to re-open in case you need any help with xsd2json.