[jbosstools-dev] Question on xsd catalog entries

Rob Cernich rcernich at redhat.com
Fri Jun 6 11:32:35 EDT 2014


> Hi All:
> 
> So I recently (few months back?) moved all xsd files out into a
> standalone plugin for contributing catalog entries. This has overall
> proven ok, but there's an issue and I'm not sure how to fix it.
> 
> A typical xsd entry in my catalog.xml file looks like this:
> 
>          <public publicId="urn:jboss:deployment-structure:1.2"
> uri="xsd/jboss-deployment-structure-1_2.xsd"/>

This relative URI is appended to the "base" URI, which is the location of your catalog file, unless xml:base is defined for the catalog.

> 
> 
> The problem is when, in eclipse, you try to make a new xml file, and use
> this catalog entry, the generated xml file looks like this:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <p:jboss-deployment-structure
> xmlns:p="urn:jboss:deployment-structure:1.2"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="urn:jboss:deployment-structure:1.2
> file:///home/rob/code/jbtools/github/jbosstools-server/as/plugins/org.jboss.tools.as.catalog/schema/xsd/jboss-deployment-structure-1_2.xsd
> "></p:jboss-deployment-structure>
> 
> 
> The part here that's clearly wrong is:
> xsi:schemaLocation="urn:jboss:deployment-structure:1.2
> file:///home/rob/code/jbtools/github/jbosstools-server/as/plugins/org.jboss.tools.as.catalog/schema/xsd/jboss-deployment-structure-1_2.xsd
> "
> 
> This is bad because these files can't really be saved in a shared
> repository if it includes full paths to the schema file.

Relative paths are resolved using the location of the document as the "base" uri, which means it won't draw from a repository anyway.  Consumers will need to provide a namespace locator to get these to resolve, which would probably ignore anything specified in schemaLocation (i.e. it's probably working off the publicId's, just like your catalog).  This seems like a bug in Eclipse, although that _is_ the location of the schema, so I could see it not being a bug too.

I'd root around in the wst code base to see if there is some configuration setting you can use to control what gets populated there.  Another option is to just leave it out.  Sorry I couldn't be more help.

> 
> Does anyone know how I should modify my catalog entries so that the
> generated xml does not include absolute filesystem urls?
> 
> This was realized by Martin in a comment on JBIDE-16358
> 
> Any help is greatly appreciated.
> 
> - Rob Stryker
> _______________________________________________
> jbosstools-dev mailing list
> jbosstools-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/jbosstools-dev
> 


More information about the jbosstools-dev mailing list