3

please tell me how to parse or validate XML with XSD using JavaScript?

dirkgently
  • 108,024
  • 16
  • 131
  • 187
Venkat Vakiti
  • 111
  • 4
  • 9

2 Answers2

1

If it's client-side (in-browser) Javascript, I'm not aware of any XSD validator that runs in the browser. I would create a server-side validation service and invoke it from Javascript as a web service.

Michael Kay
  • 156,231
  • 11
  • 92
  • 164
-2

You can't do it, unless you are OK with the validation working only in internet explorer. If that's fine please check this: http://technosatish.blogspot.com/2008/06/javascript-xsd-validation-and-examples.html

c2h5oh
  • 4,492
  • 2
  • 23
  • 30
  • 2
    The statement "You can't do it, unless you are OK with the validation working only in internet explorer" is probably wrong. Furthermore, answers are more valuable if you explain how one might go about implementing your suggestion rather than just posting a link. – Samuel Harmer Oct 31 '12 at 12:28
  • Not precise enough maybe: No Javascript XSD validator exists, the only tool I am aware of that will do it is MSXML2 run via ActiveX and is IE exclusive. The link pasted provides full code of the validator working in IE, including an example. – c2h5oh Oct 31 '12 at 15:36