2014-03-04 179 views
0

我試圖從相當多的XSD生成一些Java代碼。他們大多數工作相當不錯,但我有一個特定的XSD導入另一個XSD與相對路徑的麻煩。一個例子:Jaxb2目錄文件與相對路徑

<?xml version="1.0" encoding="UTF-8"?> 
<schema xmlns:xmpl="http://example.com/this/is/namespace" xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://example.com/this/is/namespace"> 
    <include schemaLocation="../../0301/required.xsd" /> 
    <some> ... xml ... </some> 
</schema> 

這是一個匿名化的XSD,當然是因爲客戶端。但是,我已經在其他模塊中構建了另一個XSD。順便說一下,這很有效。所以現在我想解決包括,但我目前沒有成功。我曾嘗試不同的多個目錄,比如:

<!DOCTYPE catalog 
    PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" 
    "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd"> 
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="public"> 

    <public publicId="required.xsd" uri="maven:com.geodan.imgeo:stuf!stuf0301!stuf/stuf0301.xsd" /> 

    <public publicId="../../0301/required.xsd" uri="maven:com.project.example!module!folder/required.xsd" /> 

    <public publicId="http://example.com/this/is/namespace/required.xsd" uri="maven:com.project.example!module!folder/required.xsd" /> 

    <public publicId="http://example.com/this/is/namespace/../../required.xsd" uri="maven:com.project.example!module!folder/required.xsd" /> 

    <public publicId="http://example.com/stuf0301.xsd" uri="maven:com.project.example!module!folder/required.xsd" /> 

</catalog> 

-- 
    Standard Catalog test file for Imgeo 
-- 

PUBLIC "http://example.com/this/is/namespace/required.xsd" "module/src/main/resources/folder/required.xsd" 

PUBLIC "../../0301/required.xsd" "module/src/main/resources/folder/required.xsd" 

PUBLIC "0301/required.xsd" "module/src/main/resources/folder/required.xsd" 

,但它只是將無法正常工作。任何人有任何想法?

回答