두 번째 수준을 가져 오는 최상위 수준 xsd가 주어지면 세 번째 수준을 가져옵니다. 첫 번째 수준에서 세 번째 형식을 사용할 수 있습니까? 아니면 첫 번째가 세 번째를 직접 가져와야합니까? type
만약가져 오기에서 가져온 xsd의 사용 유형
답변
당신이 다음에 대해 얘기하는 것입니다 .. 그것은 <xs:Include>
하지 <xs:Import>
..
의 그 대답은 다음과 같습니다 파서
아래의 예를 참조 함께 모든 XSD를 연결을 담당 :
,691,363 : 내가 XSD를 설계하는 것입니다 위의 XML의<?xml version="1.0" encoding="utf-8"?>
<root>
<child>trial</child>
<child2>trial2</child2>
<trunk>
<branch>1</branch>
<branch>2</branch>
</trunk>
<specialchild>test</specialchild>
</root>
(210)
<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:include schemaLocation="include multiple XSDs2.xsd"/>
<xs:element name="root" type ="root"/>
<xs:complexType name="root">
<xs:sequence>
<xs:element name="child" type="xs:string" />
<xs:element name="child2" type="xs:string" />
<xs:element name="trunk" type="trunk"/>
<xs:element name="specialchild" type="specialchild"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
형 트렁크
import multiple XSDs2.xsd
파일에 정의와 연결 (같은 폴더에 존재한다)
<xs:include>
.. ..를 사용하여 그리고 코드는 다음처럼 보이는
:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:include schemaLocation="include multiple XSDs3.xsd"/>
<xs:complexType name="trunk">
<xs:sequence>
<xs:element maxOccurs="unbounded" name="branch" type="branch" />
</xs:sequence>
</xs:complexType>
</xs:schema>
입력 지점이있다 간단한 유형은 include multiple XSDs3.xsd
파일에 정의하고, 코드는 다음과 같습니다
<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:simpleType name="branch">
<xs:restriction base="xs:string"/>
</xs:simpleType>
<xs:simpleType name="specialchild">
<xs:restriction base="xs:string"/>
</xs:simpleType>
</xs:schema>
* 이제 까다로운 부분은 다음과 같습니다 specialchild
이 곳으로 XSD_1
에 선언 XSD_3
에 정의되어 있으며이 두 XSD는 XSD_2
에 의해 연결됩니다. 기본적으로 파서는 모든 XSD를 연결하고 모든 것을 하나로 취급한다는 것을 알 수 있습니다! *
호프가 궁금한 점이 있으시면
좋은 질문입니다! 스펙을 읽는 것부터, 나는 정말로 말할 수 없다. 이행 적 수입 문제를 명시 적으로 명시 적으로 다루지는 않습니다. 본서에서
(부품 0), 그들은 단지 수입의 약 수준을 이야기 : 구조 (1 부)에서, 그것은 또한 만은 해결의 수단 "에 대해 이야기하기 때문에 http://www.w3.org/TR/2004/REC-xmlschema-1-20041028/structures.html#composition-schemaImport를 가져 직접 정의 http://www.w3.org/TR/xmlschema-0/#import foreign component "(네임 스페이스를 의미한다고 생각합니다)를 사용하면 가져온 스키마를 명시 적으로 처리하는 방법이 필요하다고 가정하는 것이 타당합니다. 즉, 가져 오기의 명시 적 네임 스페이스가 각각 필요합니다. 그 게시물에 대해 가장 관심 무엇
다른 XSD 프로세서 다른 가지고있다 :
구글 검색 다른 사람들이이 문제로 혼동되어 있는지 보여줍니다 행동 - 프로세서의 작성자도 혼란 스러웠다 고 제안했다.
이러한 게시물 (2002 년, 2005 년) 이후로 변경되었을 수도 있지만 현명한 코스는 모든 프로세서에서 작동하므로 직접 가져 오기를 사용하는 것입니다.
내가 말한대로 : 좋은 질문입니다. 여기
은 (이 그것이 다른 ... 다른 XSD 프로세서를 사용하는 사람을 위해 작동을 보장하지 않습니다 물론)는 XSD 프로세서를 확인하는 테스트입니다. 내가 가장 좋아하는 제품 (xmllint)이 이 아니며이 아닌 transitive imports를 발견했습니다.
시험은 세 스키마이다 a.xsd 차례로 수입 는을 c.xsd b.xsd 수입;
<!-- a.xsd -->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:c="http://www.c.com" targetNamespace="http://www.a.com">
<xsd:import namespace="http://www.b.com" schemaLocation="b.xsd"/>
<!-- UNCOMMENT FOR DIRECT IMPORT
<xsd:import namespace="http://www.c.com" schemaLocation="c.xsd"/>
-->
<xsd:element name="eg" type="c:TypeC"/>
</xsd:schema>
<!-- b.xsd -->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:import namespace="http://www.c.com" schemaLocation="c.xsd"/>
</xsd:schema>
<!-- c.xsd -->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.c.com">
<xsd:simpleType name="TypeC">
<xsd:restriction base="xsd:string"/>
</xsd:simpleType>
</xsd:schema>
<!-- a.xml -->
<eg xmlns="http://www.a.com">hello world</eg>
$ xmllint --schema a.xsd a.xml --noout
a.xsd:6: element element: Schemas parser error : Element
'{http://www.w3.org/2001/XMLSchema}element', attribute 'type': References from
this schema to components in the namespace 'http://www.c.com' are not allowed,
since not indicated by an import statement.
WXS schema a.xsd failed to compile
오류 메시지는 다음과 같습니다 : References from this schema to components in the namespace 'http://www.c.com' are not allowed, since not indicated by an import statement.
, xmllint가의 개발자가 적어도 수입은 이적 아니라는 것을 확신 것을 제안하고 에 정의 된 유형은이 a.xsd에서 참조 c.xsd.
- 1. 가져 오기에서 변수 사용
- 2. XSD의 혼합 유형
- 3. 노드 가져 오기에서 유형 '콘텐츠 분류 목록'을 볼 수 없습니다.
- 4. mysql 가져 오기에서 중복되는 기본 키 확인
- 5. 왜이 덤프가 가져 오기에서 실패합니까?
- 6. Magento Dataflow 제품 가져 오기에서 super_attribute 필드를 가져 오지 못함
- 7. 피드 가져 오기에서 모든 CSV 항목을 가져 오지 않습니다.
- 8. xsd의 추상화
- 9. Java에서 XSD의 프로그래밍 시험
- 10. FontForge SVG 가져 오기에서 글리프 크기
- 11. edmx에서 추가 기능 가져 오기에서 컴플렉스가 비활성화되었습니다.
- 12. 가져 오기에서 "as"속성을 지원하지 않습니다.
- 13. 지연 가져 오기에서 세션 된 오류 발생
- 14. Java 가져 오기에서 와일드 카드는 어떻게 작동합니까?
- 15. ListView 가져 오기에서 클래스 캐스트 예외 getItem
- 16. CSS 가져 오기에서 XSLT 변수 호출
- 17. excel에서 데이터 가져 오기에서 문제가 발생합니다.
- 18. FileMaker - onRecordCommit이 가져 오기에서 실행을 트리거합니까?
- 19. (SQL 가져 오기에서) wordpress 설치 지연 문제
- 20. Eclipse의 패키지 가져 오기에서 패키지 제외
- 21. PyDev : 가져 오기에서 정의되지 않은 변수 : __name__
- 22. 델파이에서 가져온 유형 라이브러리에 나타나는 메소드가 없습니다.
- 23. .jar에서 가져온 MigLayout 사용
- 24. jQuery ColorBox는 아약스 이미지 가져 오기에서 완전히 계약을 맺습니다.
- 25. XSD의 스키마?
- 26. XSD의 기본값
- 27. xsd의 고유 키 찾기?
- 28. django.utils.functional에서 가져 오기 wraps 및 functools 가져 오기에서 랩
- 29. 오류 DLL에 가져온 기능을 사용
- 30. XML, XSD의 XS : 재귀 복합 유형 (고화질) 내에서 keyref