Im currently using an apex class with Dom.Document to generate an XML file which then gets sent off to an external endpoint.

I would like to be able to validate the XML file against an existing XSD file before sending it off. Is there anyway to do this in salesforce with the DOM.document or any other method, other than writing my own apex code to validate it.

Thank you in advance. I have searched on this site and many other places and haven't came across anything yet.


Trying to validate in Apex would be a mess of a project! I would probably go with running a pre-built library (like javax.xml.validation) on Heroku, and passing your file off for processing that way.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.