aspose file tools*
The moose likes XML and Related Technologies and the fly likes URL, URI and URN Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "URL, URI and URN" Watch "URL, URI and URN" New topic
Author

URL, URI and URN

Sandeep Jindal
Ranch Hand

Joined: Aug 25, 2003
Posts: 180
Hello,
I am new to XML. I know that URL and URN are part of URI. But i m confused for the difference between URL and URN.
Please explain with apropiate example


SCJP 5.0
http://sites.google.com/site/duddlutechnologies/home
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
A URL (Uniform Resource Locator) is a kind of address while a URN (Uniform Resource Name) is just a name without any hint about the actual location of the particular resource.
For example, "http://www.google.com" is a URL while "urn:google" is a URN.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Sandeep Jindal
Ranch Hand

Joined: Aug 25, 2003
Posts: 180
Thanks Lasse,
So you mean to say that any valid string "google1", "google.com", "1google", "1-google", "1.google" is a URN
or in better words a namespace. Or there is some restriction on the URN?
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
There are some rules, which are listed in RFC 2141. For example, a valid URN must begin with the "urn:" prefix.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: URL, URI and URN