Need to validate XML against XSD using python

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Deathwing
    New Member
    • Mar 2007
    • 32

    Need to validate XML against XSD using python

    Hello everyone,

    I need to find out how or if it is possible to validate an XML document against XSD using Python. I'd like to write a script that would do the validation and return a simple PASS or FAIL to notify the user that the XML document either failed or passed the validation? I hope I'm making sense. Thanks very much.
  • alebald
    New Member
    • Jul 2007
    • 2

    #2
    Originally posted by Deathwing
    Hello everyone,

    I need to find out how or if it is possible to validate an XML document against XSD using Python. I'd like to write a script that would do the validation and return a simple PASS or FAIL to notify the user that the XML document either failed or passed the validation? I hope I'm making sense. Thanks very much.

    first you need to install lxml for python. then follow the following example

    http://codespeak.net/lxml/api.html

    Regards

    Ali

    Comment

    • alebald
      New Member
      • Jul 2007
      • 2

      #3
      Originally posted by Deathwing
      Hello everyone,

      I need to find out how or if it is possible to validate an XML document against XSD using Python. I'd like to write a script that would do the validation and return a simple PASS or FAIL to notify the user that the XML document either failed or passed the validation? I hope I'm making sense. Thanks very much.

      or more specifically
      http://codespeak.net/lxml/validation.html

      Regards

      Ali

      Comment

      Working...