about xml schema validations

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • 33sparsh
    New Member
    • Aug 2007
    • 3

    about xml schema validations

    Hi,

    i am new to XML.

    i want to validate user input data with .XSD file(before saving the data in xml file) .
    how can i validate it through the .net code.

    validate xml file with .xsd is ok,any data is mismatch it will throw error. But what my requirement is when user enter a value in text box(user name) this user name attribute had a definition in .xsd . According to given schema definition the control will be validated when i click "next button".

    please help me.....

    Thanq,
    kiran.
  • jkmyoung
    Recognized Expert Top Contributor
    • Mar 2006
    • 2057

    #2
    How are you sending the data? Are you using ASP?

    Also, did you want the data validated before it is sent, eg throwing javascript popup window errors, or are you going to resend the page back to the user listing the errors they have in the form?

    Comment

    • 33sparsh
      New Member
      • Aug 2007
      • 3

      #3
      Originally posted by jkmyoung
      How are you sending the data? Are you using ASP?

      Also, did you want the data validated before it is sent, eg throwing javascript popup window errors, or are you going to resend the page back to the user listing the errors they have in the form?
      hi,
      i am using ASP.Net.i want to validate before it is sent to next page. i display the errors in the form it self if any control was not validate. i want to validate control value(text box or ..) with more than one .xsd . if any one can mismatch it will throw error to the user , this is my requirement .

      thanks&regards
      kiran

      Comment

      • jkmyoung
        Recognized Expert Top Contributor
        • Mar 2006
        • 2057

        #4
        Schema was more designed to validate against an entire document. You could build the document, send it to be validated and report back errors, but this is time-consuming and wasteful if you just want a single field validated.

        I would recommend coding a custom solution for each field, or modularize this process such that you could automatically generate validation scripts for each part in the schema. To the best of my knowledge, there is no public tool that does what you are looking for, against XML schema definitions anyways.

        Are you validating more than just simple types? eg, xs:integer, xs:dateTime? or do you have complicated types?

        This site does not have XML validation, but may help if you validate by field.

        Comment

        Working...