SVG 이미지 태그를 지원하는 XSD 체계를 ISOSTS 확장하려고합니다. XSD scheme for SVG을 찾아 ISOSTS.xsd
근처에 두었습니다.SVG를 지원하기 위해 XSD 체계를 확장하는 방법은 무엇입니까?
<?xml version="1.0" encoding="utf-8"?>
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:mml="http://www.w3.org/1998/Math/MathML"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tbx="urn:iso:std:iso:30042:ed-1"
xmlns:xlink="http://www.w3.org/1999/xlink"
<!-- my line -->
xmlns:svg="http://www.w3.org/2000/svg"
elementFormDefault="qualified">
<xs:import namespace="http://www.w3.org/1998/Math/MathML"
schemaLocation="ncbi-mathml2/mathml2.xsd"/>
<xs:import namespace="http://www.w3.org/1999/xlink"
schemaLocation="xlink.xsd"/>
<!-- XSD import of namespace http://www.w3.org/2001/XMLSchema-instance suppressed (not necessary) -->
<xs:import namespace="http://www.w3.org/XML/1998/namespace"
schemaLocation="xml.xsd"/>
<xs:import namespace="urn:iso:std:iso:30042:ed-1"
schemaLocation="tbx.xsd"/>
<!-- my line -->
<xs:import namespace="http://www.w3.org/2000/svg"
schemaLocation="SVG.xsd"/>
....
<xs:element name="p">
<xs:complexType mixed="true">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<!-- my line --> <xs:element ref="svg:svg"/>
<xs:element ref="email"/>
....
그러나 시도가 계획로드 할 때 오류가 있습니다 : 는 지금은 ISOSTS.xsd
을 확장하려고
from lxml.etree import parse, XMLSchema
schema_file = open(self._schema_filename)
schema_doc = parse(schema_file)
schema_file.close()
self._xmlschema = XMLSchema(schema_doc) # Error
오류 메시지 :
File "src/lxml/xmlschema.pxi", line 87, in lxml.etree.XMLSchema.init (src/lxml/lxml.etree.c:197819)
lxml.etree.XMLSchemaParseError: Element '{ http://www.w3.org/2001/XMLSchema }element', attribute 'ref': References from this schema to components in the namespace ' http://www.w3.org/2000/svg ' are not allowed, since not indicated by an import statement., line 4664
잘못 무엇입니까?
사실, 영업 이익은 않습니다 SVG 스키마를 가져옵니다. 그것은 일종의 XSD 추출물에 묻혀 있지만 거기에 있습니다. 나는 그것을 더 잘 보이게하기 위해 편집했습니다. –