ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Prashant <prash...@pramati.com>
Subject About schemavalidate Was (Re: xmlvalidate with remote schemas)
Date Tue, 26 Sep 2006 13:48:40 GMT
Steve Loughran wrote:
> Ant 1.7's <schemavalidate> extension to <xmlvalidate> sets things up 
> right for all nested <schema> elements.
>
> If you cannot use the beta, look at the source, see how we set up the 
> property
> http://apache.org/xml/properties/schema/external-schemaLocation
Thats neat.

I googled <schemavalidate> and came up with this[1] explanation on this 
little feature.

I have a question on why the namespace is chosen as the key against 
which the local XSD can be pointed out.

 <schema namespace="http://schemas.xmlsoap.org/ws/2003/03/addressing" file="${ws-addressing.xsd}"
/>

It turns out that all J2EE 1.4 XSDs belong to same namespace [2]. 
Further J2EE specifies that the XML instance documents specify the 
schemaLocation hint using xsi:schemaLocation attribute

Something like :
for web.xml : <web-app xmlns="http://java.sun.com/xml/ns/j2ee" 
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/web-app_2_4.xsd" version="2.4">

For ejb-jar.xml : <ejb-jar version="2.1" 
xmlns="http://java.sun.com/xml/ns/j2ee" 
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/ejb-jar_2_1.xsd">

Observe how the xmlns value for both XML instance documents is same.

How would one use the <schema namespace=/> thingie in these cases to 
locate web_2_.4.xsd / ejb-jar_2.1.xsd locally ?

Thanks.
-Prashant



[1]http://mail-archives.apache.org/mod_mbox/ws-axis-dev/200502.mbox/%3C421DC447.3000300@apache.org%3E
[2] http://java.sun.com/xml/ns/j2ee/#resources

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message