users@jaxb.java.net

Re: xs:anyURI and java.net.URL

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Mon, 23 Jun 2003 15:31:56 -0700

Using the java.net.URL class will let you access the resource easily. So
if your schema uses xs:anyURI to represent an accessible resource, go
ahead and use java.net.URL.

OTOH, xs:anyURI is often used to represent an abstract identifier where
one is not expected to access the resource itself (such as URIs used as
namespace URIs) In this case, java.net.URL doesn't work well.

For example, "urn:kohsuke:myproject:extension" is (I think) a correct URI,
but java.net.URL won't even parse it.

So the answer depends on what kind of URI your schema is using.

--
Kohsuke Kawaguchi <kohsuke.kawaguchi_at_sun.com>