[jbosstools-dev] Question on xsd catalog entries

Max Rydahl Andersen manderse at redhat.com
Thu Jun 12 04:09:25 EDT 2014


On 11 Jun 2014, at 16:01, Rob Stryker wrote:

> I'd just like to point out the space is here as well, so the space 
> thing, at least, is a wtp problem ;)

space ?


Anyways my first guess/attempt is that the docs on 
https://wiki.eclipse.org/Using_the_XML_Catalog explains it:

"Note : If your XML document specificed relative schema locations (e.g. 
'foo.xsd' as show below) then an XML Schema can NOT be registered using 
"foo.xsd" as the Schema Location key. TODO.. reference section below 
that describes why this is the case and how XML Catalog v1.1 provides a 
way to partially solve this.

  <xyz:foo xmln:xyz="http://www.example.org/foo/" 
xsi:schemaLocation="foo.xsd" ...
"

and then in FAQ it shows:

I've registered an XML Schema by namespace but XML files are still using 
the 'xsi:schemaLocation' value. Why?
An explicitly specified schema location value takes precedence over XML 
Catalog entries that are keyed by namespace.

...so sounds like we need a namespace declaration to overrule the 
relative specified one in the catalog ?

/max

> On 06/11/2014 07:41 PM, Martin Malina wrote:
>> I don’t think so, no.
>>
>> A couple of examples:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <http:address location="http://tempuri.org" 
>> xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" 
>> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
>> xsi:schemaLocation="http://schemas.xmlsoap.org/wsdl/http/ 
>> http://schemas.xmlsoap.org/wsdl/http/ "></http:address>
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <j2ee:application version="1.4" 
>> xmlns:j2ee="http://java.sun.com/xml/ns/j2ee" 
>> xmlns:xml="http://www.w3.org/XML/1998/namespace" 
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
>> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
>> http://java.sun.com/xml/ns/j2ee/application_1_4.xsd ">
>> <j2ee:module>
>>  <j2ee:connector>token</j2ee:connector>
>> </j2ee:module>
>> </j2ee:application>
>>
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <javaee:faces-config version="2.0" 
>> xmlns:javaee="http://java.sun.com/xml/ns/javaee" 
>> xmlns:xml="http://www.w3.org/XML/1998/namespace" 
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
>> xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
>> http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd 
>> "></javaee:faces-config>
>>
>>
>> -Martin
>>
>> On 11. 6. 2014, at 1:41, Max Rydahl Andersen <manderse at redhat.com> 
>> wrote:
>>
>>> Before I go digg deeper - does this also happen for xsd's provided 
>>> by
>>> eclipse or wtp itself ?
>>>
>>> /max
>>>
>>>> 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"/>
>>>>
>>>>
>>>> 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.
>>>>
>>>> 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
>>>
>>> /max
>>> http://about.me/maxandersen
>>>
>>> _______________________________________________
>>> jbosstools-dev mailing list
>>> jbosstools-dev at lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/jbosstools-dev


/max
http://about.me/maxandersen



More information about the jbosstools-dev mailing list