2013-05-21 10 views
16

hataHata: "schemaLocation value ***, çift sayıda URI değerine sahip olmalıdır." bahar memuru içinde ad alanlarını

<Ignored XML validation warning> org.xml.sax.SAXParseException; lineNumber: 9; columnNumber: 55; 
SchemaLocation: schemaLocation value = 'http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd 
http://www.springframework.org/schema/tx' must have even number of URI's. 

aşağıdaki başlamıştı ve benim memuru servlet aşağıdaki ad alanları

<beans xmlns="http://www.springframework.org/schema/beans" 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xmlns:p="http://www.springframework.org/schema/p" 
     xmlns:aop="http://www.springframework.org/schema/aop" 
     xmlns:tx="http://www.springframework.org/schema/tx" 
     xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
     http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd 
     http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd"> 

başlamıştı ve ben

<beans xmlns="http://www.springframework.org/schema/beans" 
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
       xsi:schemaLocation="http://www.springframework.org/schema/beans 
       http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"> 

Ve izleyerek her şeyden yerini benim hata ortadan kayboldu.
Nasıl oldu, kimse nasıl söyleyebilir?

cevap

56

schemaLocation özniteliği, ad alanı için bir XML Şeması belgesine başvurur. Temelde

yazarken:

xmlns:expns="http://www.example.com" 
xsi:schemaLocation="http://www.example.com 
        http://www.example.com/schema/example.xsd" 

Sen diyorsun:. "Benhttp://www.example.comAyrıca ad alanının elemanları önekexpnskullanmak için gidiyorum, sen doğrulayabilmeleri bu elemanlar, içindehttp://www.example.comiçin XSD şema dosyası almakhttp://www.example.com/schema/example.xsd "

Yani, bir başka deyişle, biçimi şöyledir: vb

xsi:schemaLocation="namespace-a where_to_get_the_xsd_for_namespace-a 
        namespace-b where_to_get_the_xsd_for_namespace-b 
        namespace-c where_to_get_the_xsd_for_namespace-c" 

Ve.

Bu yüzden bana hatta numaranız olması gerekir.


Daha fazla bilgi ve örnekler here bulunabilir.

+0

Peki bu sorunu nasıl düzeltirsiniz? Aslında şu anda bir şey yapmadığı için doğru biçimlendirilmemiş 'xsi: schemaLocation' öğesini kaldırıyor musunuz? İsim alanının ne olduğunu öğreniyor musun? Öyleyse nasıl? –

+0

@StephenOstermiller Girdiyi (xade: schemaLocation) 'da eşit olmayan hale getirecek şekilde düzeltebilir (karşılığını ekleyebilirsiniz) ya da conterpart için doğru değeri bilmiyorsanız girişi kaldırın (gerek yok) tüm xsi: schemaLocation 'kaldırmak için, bu da işe yarayacak, sanırım). – acdcjunior

İlgili konular