users@jaxb.java.net

Re: Resolve the schema location from the classpath?

From: ostracke <olaf.stracke_at_pangora.com>
Date: Tue, 5 Aug 2008 01:36:08 -0700 (PDT)

Hi Lexi,

great job, thank you. It will help so much.

Two little remarks:
1. I get a NullPointerException in that case,
 the catalog cannot resolve the system or
 public ID.
 It would be very helpful, if you would try
 to use the systemID instead. So the
 ClasspathCatalogResolver can work with
 classpath-systemIDs without any
 catalog-file.
2. Usally (but I donĀ“t know why) the
 classpath-entry starts with a '/'-char.

But, of course, with the catalogResolver
config element I can implement these
two things on my own, if I would really
need them.

Again, thank you very much.
Bye
Olaf

 


Aleksei Valikov wrote:
>
> Hi folks,
>
> I have resolved both issues discussed in this thread.
>
> 1. I've added a new <catalogResolver/> option to the
> maven-jaxb2-plugin. You can use this option to configure a custom
> catalog resolver (must be a subclass of
> com.sun.org.apache.xml.internal.resolver.tools.CatalogResolver). In
> your subclass you may override a method like
> getResolvedEntity (String publicId, String systemId) so implement your
> own entity resolution.
>
> 2. I've written the
> org.jvnet.jaxb2.maven2.resolver.tools.ClasspathCatalogResolver which
> is capable of handling classpath:com/acme/foo/myschema.xsd links.
>
> 3. Concerning the question by Malachi, it appeares that the catalog
> specification can handle this just fine. There is a reqriteSystem (or
> REWRITE_SYSTEM) element for instance allows to specify that everything
> at http://www.acme.com/foo should be read from classpath:com/acme/foo:
>
> REWRITE_SYSTEM "http://www.acme.com/foo" "classpath:com/acme/foo"
>
> 4. I've updated the catalog and episode tests/samples so you can take
> a look how it's done.
>
>
> For examples, take a look at the following two tests:
>
> https://maven-jaxb2-plugin.dev.java.net/svn/maven-jaxb2-plugin/trunk/tests/catalog/
> https://maven-jaxb2-plugin.dev.java.net/svn/maven-jaxb2-plugin/trunk/tests/episodes/
>
> All these changes are done in version 0.6.1, will be released this
> evening.
>
> Bye.
> /lexi
>
> Bye.
> /lexi
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>
>

-- 
View this message in context: http://www.nabble.com/Resolve-the-schema-location-from-the-classpath--tp7372851p18826808.html
Sent from the java.net - jaxb users mailing list archive at Nabble.com.