2012-05-02 3 views
3

xsd : schemaLocation에 xsd를 넣으면 인터넷에서 xsd를 다운로드하고 xml을 확인합니까?시스템 xsd를 사용하는 xml의 오프라인 유효성 확인

xsd를 다운로드하여 오프라인 유효성 검사를하고 싶습니다. 어떻게해야합니까?

DTD에 대한 오프라인 확인을 수행하는 방법을 알고 있지만 xsd에 대해서는 확실하지 않습니다. DTD의 내용은

, 나는 현재하고있는 중이 야 다음

<!DOCTYPE struts-config SYSTEM "struts-config_1_1.dtd"> 

내가 이런 일을 할 수 있습니까?

편집

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

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

에서 : 내가 잘못처럼

보인다. jar 파일에서 dtd/xsd를 찾지 못하면 스프링은 인터넷으로 만 이동합니다. 인터넷 플러그를 뽑아서 응용 프로그램이 제대로 작동하는 것을 보았습니다. 또한

, 소스 : 문제와 잘못된 질문에 대한 https://forum.hibernate.org/viewtopic.php?f=1&t=949031

죄송합니다.

+0

다운로드할까요? "그것"은 누구인가? 다른 소프트웨어가 다르게 동작합니다. 소프트웨어가 "무엇"인지 모르는 상태에서 소프트웨어가 어떻게 작동하는지 말할 수 없습니다. –

+0

@MichaelKay 내 잘못한 질문. 다운로드를하고 오프라인에서도 올바르게 작동합니다. –

답변

0

예, 가능합니다. URI가 스키마 (file : // 귀하의 경우, Windows에서는 file : // c : /something/my.xsd와 유사 함)에 대해 유효해야합니다.

모든 XSD 파일이 로컬로 저장되고 XSD 파일 간의 모든 참조가 올바른지 확인하십시오.

+0

절대 경로, file : // c : /something/my.xsd 대신에 상대 URI 인 file : //my.xsd를 제공 할 수 있습니까? –

+1

나는 relative :에 file : //을 사용하지 않을 것이다. 그냥 ./my.xsd (친척을위한 스키마를 쓰지 마라.). –

관련 문제