[jbosstools-dev] XML Catalog, assistance needed
Rob Stryker
rstryker at redhat.com
Mon Apr 7 03:32:17 EDT 2014
Hi:
I'm looking at separating out the xml schema catalog entries into their
own plugin, and a request has been made to add even more schemas. But
I'm having a problem discovering how to do it uniformly. There are
several syntaxes used to add entries, and I really don't know which
syntax to use and when:
We use the following syntaxes at varying times:
This first one (FORMAT 1) is most often used by our legacy dtd's, and I
honestly have no idea how it works at all:
<public publicId="-//JBoss//DTD JBOSS 4.0//EN"
uri="platform:/plugin/org.jboss.tools.as.catalog/dtd/jboss_4_0.dtd"
webURL="http://www.jboss.org/j2ee/dtd/jboss_4_0.dtd"/>
I've seen this next entry (FORMAT 2) added as well. The thing to note
here is that the name attribute, which I believe represents namespace,
is set to http://www.jboss.com/xml/ns/javaee, but an open jira indicates
this type of catalog entry will form invalid xml files and we should
avoid it.
<uri name="http://www.jboss.com/xml/ns/javaee"
uri="platform:/plugin/org.jboss.tools.as.catalog/dtd/jbossws-web-services_1_0.xsd"/>
The next syntax (FORMAT 3) is similar, but seems to have a namespace
that points to a specific xsd file.
<uri name="http://www.jboss.org/j2ee/schema/jboss_5_0.xsd"
uri="platform:/plugin/org.jboss.tools.as.catalog/dtd/jboss_5_0.xsd"/>
The fourth (FORMAT 4) seems most often used by our newest schema, and
seems the most successful one.
<uri name="urn:jboss:1.0"
uri="platform:/plugin/org.jboss.tools.as.catalog/dtd/jboss_1_0.xsd"/>
The problem for me is that when I look at many other xsd files that
could be added, they don't show namespaces in a urn:jboss format.
Looking at the xsd files directly, they also don't have a string like
"http://www.jboss.org/j2ee/schema/jboss_5_0.xsd" anywhere in the xsd
file, so I can't use formats 4 or 3. I have no idea how format 1 works,
and format 2 has been indicated to be non-functional.
So if I want to add an xsd file that has header like the one below, I
have no idea how to add it:
<xsd:schema
targetNamespace="http://java.sun.com/xml/ns/javaee"
xmlns:javaee="http://java.sun.com/xml/ns/javaee"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
version="2.1">
Ideally, I would make a small script in the plugin to regenerate the
catalog entries based on what files are in the folder. This way it'd be
deterministic, and we can add whole collections of schemas after each
new major release of jee or wildfly. But I really can't figure out which
catalog entry forms to use against what types of xsd files or how to
properly map it at all.
Any help here would be very much appreciated.
More information about the jbosstools-dev
mailing list