facebook

How to validate XML file using XML Schema?

  1. MyEclipse Archived
  2.  > 
  3. Web Development (HTML, CSS, etc.)
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #231856 Reply

    Hi,

    I would like if someone could share two sample files:

    – A xml schema
    – A xml file based on the schema above

    and steps in MyEclipse about how to validate this xml file.

    Do I need to do anything in the XML Catalog window to make sure the validation works? Any input is appreciated.

    Thanks,

    – Satish

    #231862 Reply

    Riyad Kalla
    Member

    Satish,
    You don’t need to mess with the catalog. Just make sure your URL to the schema (from the XML) is valid, the editor will load it up (either locally or remotely) and validate it for you.

    TIP: If the schema and XML are in the same directory, you don’t need to include a path for the schema in the XML file, you can just give it’s name. Default behavior of the validating parser is to then load it from the same dir as the XML file. You’ll notice in most files, this location is some remote locaiton like http://www.sun.com/schemas/web_2.4.xml or something like that, this way it is *universally* accessible. In the case where you work offline and don’t have net access, you WOULD use the catalog to register a local copy of that schema so the editor didn’t throw an exception when it tried to load the remote file and failed.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: How to validate XML file using XML Schema?

You must be logged in to post in the forum log in