• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Validating XML document if URI is invalid

 
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In J2EE Web Services book , I have just read that URI may or may not point to an actual document or resource . If it could not point to the actual document or resource then how XML document be validated ?

If I have used URL as URI and my internet is down , how it will be able to access the schema and validate XML document.

Thanks,
Tanu
 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

tanu dua wrote:In J2EE Web Services book , I have just read that URI may or may not point to an actual document or resource . If it could not point to the actual document or resource then how XML document be validated ?

If I have used URL as URI and my internet is down , how it will be able to access the schema and validate XML document.

Thanks,
Tanu



If runtime resource is not available then, you will get the Exception.
To avoid above:-
If I want to validate generated XML document, first of all I would have access to schema then only I would be able to program to generate XML document, so schema can be used locally.


P.S. I am just beginner.
 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
The URI that makes up a namespace does not have to point to an actual document or resource (as said before).
However, in an XML document you can use the schemaLocation attribute to specify a number of mappings between an URI and the location of the corresponding resource (XML schema).
Example:

In the above example, the URI http://www.ivan.com/schemas is mapped to the personSchema.xsd, which is a file containing the XML schema of the XML document above.

If you want to modify the schema locations used by, for instance, a web service, without touching the WSDL documents and XML schemas then you can use the OASIS XML Catalog, provided that it is supported by the web service stack etc.
Best wishes!
 
Did you just should on me? You should read this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic