users@jaxb.java.net

Re: imports under windows

From: <MrEasy_at_gmx.net>
Date: Wed, 6 Oct 2004 23:15:29 +0200 (MEST)

Hi,

had similar issues with compiling under *nix and win.
solution in my case was to use 3 slashes: file:///d:/win_bla/... or
file:///tmp/linux/...
because the path itself starts with a leading slash on unix, i made some
hack into the build script, maybe you'll have some use for it (I am using a
catalog file, but with the path being directly in schemaloaction it's the
same procedure):

<!-- include slash in token for resulting in 3 slashes (not 4) if OS's
filesystem itself starts with a slash -->
<echo level="info" message="Checking OS environment..."/>
    <if>
        <os family="unix"/>
        <then>
            <echo level="info" message="Unix"/>
            <property name="slashIfUnix" value="/"/>
        </then>
        <else>
            <echo level="info" message="Non-Unix"/>
            <property name="slashIfUnix" value=""/>
        </else>
    </if>

    <echo message="adding directory into catalog file: ${dir.absolute-path}"
level="info"/>
    <replace file="${build.generated.dir}/catalog.cat"
        token="${slashIfUnix}__PATTERN__"
        value="${dir.absolute-path}"/>

rico


> has anyone had difficulties resolving xsd:import ...
> schemaLocation="..." under windows?
>
> i have a large schema tree which i use xjc to compile (using the xjc ant
> task and a nested <schema> fileset) just fine on unix/osx, but which
> borks on windows. i saw a post to this list some time ago suggesting
> that you not use schemaLocation="../foo.xsd" but rather
> schemaLocation="file://../foo.xsd", so that the jvm will correctly
> resolve things (and turn '/' into '\', etc). doing this i get fewer
> errors, but still failures (types aren't being resolved or are being
> resolved more than once).
>
> any windows users have some suggestions?
>
> failing any clear shortcoming in my use of the above, i might introduce
> an intermediate step which creates a master schema with no elements and
> nothing but imports, and then point xjc at that single file, instead of
> using a nested <schema>. still, if i can make this work without having
> to write intermediate code, that'd be awesome.
>
> jon

-- 
+++ GMX DSL Premiumtarife 3 Monate gratis* + WLAN-Router 0,- EUR* +++
Clevere DSL-Nutzer wechseln jetzt zu GMX: http://www.gmx.net/de/go/dsl
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net