function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Kumar_14279Kumar_14279 

How to validate xml with its xsd using apex code

Hi All,

 

I am new to Apex and salesforce api. Could some one help me to find the solutions for the below specified

 

1.) Is there any inbuild validator class to validate xml with its xsd using apex code?

 

2.) Can we write direct java classes in the force.com platform and how to call them in apex class?

 

Thank You,

Kumar.

EndaEnda

Hi all,

 

I have the same issue whereby I need the ability to validate xml against an xsd within Apex.

Has anyone got any suggestions on how to do this?

 

Kumar - did you figure out a way to do this? Or did you come up with a feasible workaround?

 

Regards,
Enda.

Shane Steinfeld 32Shane Steinfeld 32
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][1]**) on Heroku, and passing your file off for processing that way:

https://docs.oracle.com/javase/8/docs/api/javax/xml/validation/package-summary.html