I realize that there is already an XML to JSON Schema Transformation as posted here:
1) What I am curious to "create" is a data flow that can validate a transformed JSON document the same way the ValidateXML processor validates an XML document. So basically transform the xml to JSON correctly, but also translate an XSD (schema) to a JSON (schema) and have it validate and produce the same results that the XML would, but just in JSON.
My Ideas: Transform the xml document into JSON and then ingest into MongoDB and use the document validation within MongoDB to validate the JSON?
If this becomes more of a discussion, I would love to hear it.
I've had success transforming the XML to JSON and then converting the JSON into Avro schema - where the JSON schema will need to adhere to the Avro schema. You can generate an Avro schema from your existing JSON by running the InferAvroSchema processor
From that XML to JSON XSLT - I'd use https://www.bjelic.net/2012/08/01/coding/convert-xml-to-json-using-xslt/#code and not the example posted (as I posted in the comments)
Thank you @Ryan Cicak ,but before I accept this as an answer, I would just like some clarification. I think you are suggesting two things here. First, that 1) I transform the XML file to JSON by applying the XSLT @ https://www.bjelic.net/2012/08/01/coding/convert-xml-to-json-using-xslt/#code which I am familiar with doing.
I am confused about 2) how to transform the XML Schema to JSON (or AVRO schema, as suggested) in order for the new JSON/AVRO schema to evaluate the JSON document that was changed by the XSLT to produce the same results as the XML Schema evaluating the XML FILE.
Avro schema is very limited if you are looking for more complex validations that XML Schema or JSON schema can provide.