2010-01-07 3 views
0

Apache Xerces 3.0.1 XInclude를 사용하고 있습니다. xinclude 메커니즘을 사용하여 XML 파일을 포함하고자합니다. 세 개의 XML 파일이 모두 같은 디렉토리에 있습니다. test_a.xml에는 test_c.xml이 xincludes 인 test_b.xml이 포함됩니다. test_a.xml xinclude test_b.xml 만 있으면 작동합니다. 그러나 test_b.xml xinclude test_c.xml 때 다음 명령 줄 오류가 발생합니다.xerces xinclude error

C : \ digital_receiver \ test> XInclude.exe test_a.xml test_z.xml 진행중인 test_a.xml 구문 분석 ... 파일 C : \ digital_receiver \ test/test_a.xml, 3 행, char 34의 치명적 오류 메시지 : URI에 스키마가 없습니다. 가 완료되었습니다.

test_a.xml :

<?xml version="1.0" encoding="ISO-8859-1"?> 
<test_a xmlns:xi="http://www.w3.org/2001/XInclude"> 
    <xi:include href="test_b.xml"/> 
</test_a> 

test_b.xml :

<?xml version="1.0" encoding="ISO-8859-1"?> 
<test_b xmlns:xi="http://www.w3.org/2001/XInclude"> 
    <ch>5</ch> 
    <xi:include href="test_c.xml"/> 
</test_b> 

test_c : XML : 어떤 도움을 주시면 감사하겠습니다

<?xml version="1.0" encoding="ISO-8859-1"?> 
<test_c> 
    <channel>1</channel> 
</test_c> 

.

답변

0

내가 말할 수있는 한, XML은 괜찮지 만 이것에 대한 마지막 단어는 아닙니다.

그것은 내 추측이의 Xerces '의 XInclude 처리의 버그를 타격하고입니다. 나는이 코드가 거의 세 살이지만, 분명히 released until Xerces 3.0이 아니기 때문에 상대적으로 테스트되지 않았을 수 있습니다. (그리고 base URIs of included documents이 XInclude에서 처리되는 방식으로 주어진다면 버그가 0보다 큰 것처럼 보일 수 있습니다.)

해결 방법으로 다음과 같은 오류 메시지에서 제안하는 방법을 제안합니다. 포함 된 파일의 URI. 아쉽게도 파일 URI의 경우 절대 URI를 사용해야합니다.

test_a.xml :

<?xml version="1.0" encoding="ISO-8859-1"?> 
<test_a xmlns:xi="http://www.w3.org/2001/XInclude"> 
    <xi:include href="file://path/to/directory/test_b.xml"/> 
</test_a> 

test_b.xml :

<?xml version="1.0" encoding="ISO-8859-1"?> 
<test_b xmlns:xi="http://www.w3.org/2001/XInclude"> 
    <ch>5</ch> 
    <xi:include href="file://path/to/directory/test_c.xml"/> 
</test_b> 

UPDATE : 실제로 apache.org에서 a similar bug 있습니다. (나는 같은 문제를 설명하고 있다고 생각하지만 보고서의 문구는 심지어 상대 경로를 사용할 때 단일 포함 레이어와 같은 소리가 나도록 만듭니다.)

+0

감사합니다. Dan. 나는 제대로 기능하기 위해 단일 계층의 포함을 얻을 수있다. 나는 그들이 버그를 고칠 때까지 기다릴 수 있다고 생각한다. – sizzle