2

We have a lot of projects that consists of XML files. We have to validate all these XML files based on a single XML schema.

In order to realize this, we have used XML Catalog entries to associate an XML Schema with a given namespace key. In this way you define the location of XML Schema only once in XML Catalog and all XML files will be validated based on this single XML Schema. You can see the XML Category Entry below:

  • Entry element: URI
  • Location: dm_d/src/DESchema.xsd
  • URI: platform:/resource/dm_d/src/DESchema.xsd
  • Key type: Namespace name
  • Key: http://www.example.com

This method works fine, BUT only thing that you have to do is to add 'xmlns' namespace attribute to root element of every single XML file in your projects.

We don't want to add the namespace attribute to each XML file, because we have to update a lot of Client projects, which is not efficient and feasible.

At the moment, we are looking for other ways of XML validation based on a single XML schema without introducing xmlns namespace to each XML file.

How can we do this in Eclipse IDE?

Normal XML Validation (e.g.: underlines when you have wrong closing tag,..) in Eclipse XML editor works without namespace. Here, you don't have to define anything that relates to XML Schema. How it is done for this normal XML validation?

Can we do the same as in the normal XML validation?

Any tips, guidance in this direction are very appreciated.

Thanks! :)

Xemox.

WicketX
  • 66
  • 4
  • Do your schemas have a target namespace? If they do, then also your instance documents need to be in that namespace. – jasso May 30 '11 at 11:13
  • Possible duplicate: [Java xsd validation of xml without namespace](http://stackoverflow.com/q/2991091/150166). – Martti Käärik Jan 09 '12 at 23:37

1 Answers1

2

How about noNamespaceSchemaLocation? http://www.w3schools.com/schema/schema_example.asp

Eric Woodruff
  • 6,380
  • 3
  • 36
  • 33