2014-02-20 3 views
0

Docbook 5 태그의 하위 집합을 기반으로하는 XSD에서 작업하고 있습니다. 여기 데 문제를 설명하기 단지 몇 태그이 XSD의 아주 작은 부분은 다음과 같습니다 Docbook 태그를 기반으로 XSD에 MathML 태그를 포함시키는 방법은 무엇입니까?

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://docbook.org/ns/docbook" targetNamespace="http://docbook.org/ns/docbook" elementFormDefault="qualified" attributeFormDefault="unqualified"> 
<xs:import namespace="http://www.w3.org/1999/xlink" schemaLocation="xlink.xsd"/> 
<xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/> 
<xs:element name="book"> 
    <xs:annotation> 
     <xs:documentation>Root element</xs:documentation> 
    </xs:annotation> 
    <xs:complexType> 
     <xs:sequence> 
      <xs:element ref="chapter" maxOccurs="unbounded"/> 
     </xs:sequence> 
     <xs:attribute ref="xml:lang" use="required"/> 
    </xs:complexType> 
</xs:element> 
<xs:element name="chapter"> 
    <xs:complexType> 
     <xs:sequence> 
      <xs:element ref="informalequation" maxOccurs="unbounded"/> 
     </xs:sequence> 
     <xs:attribute ref="xml:lang" use="required"/> 
     <xs:attribute ref="xml:id" use="required"/> 
    </xs:complexType> 
</xs:element> 
<xs:element name="informalequation"> 
    <xs:complexType> 
     <xs:attribute ref="xml:id"/> 
     <xs:attribute name="condition" use="required"> 
      <xs:simpleType> 
       <xs:restriction base="xs:string"> 
        <xs:enumeration value="block"/> 
        <xs:enumeration value="inline"/> 
       </xs:restriction> 
      </xs:simpleType> 
     </xs:attribute> 
    </xs:complexType> 
</xs:element> 

는 지금, 요소 <informalequation>에는 내용이없는 속성 만. 내가 그 안에 MathML을 형식 등의 방정식을 넣어하고 싶으면 여기

<math display='block'> 
<mrow> 
    <msqrt> 
    <mn>2</mn> 
    </msqrt> 
</mrow> 
</math> 

그리고 것이 문제입니다 ... 나는 어떻게 해야할지하지 않는 MathML을 태그는을 Docbook에 포함되지 않기 때문에 ... Altova XMLSpy 2011 Enterprise 버전을 사용하여 내 XSD를 만듭니다. 내가 을 다운로드했습니다. http://www.w3.org/Math/XMLSchema/에서 XSD를 다운로드했는데, 다음에 무엇을해야할지 모르겠습니다. 누구나 할 방법을 알고 있고 유효한 XSD를 얻을 수 있는가 그래서 나는이 구조와 기반으로 XML을 생성 할 수 있습니다?

<?xml version="1.0" encoding="UTF-8"?> 
<book xml:lang="en" version="5.0" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> 
<chapter xml:lang="en" xml:id="1"> 
    <informalequation condition="block"> 
     <math display='block'> 
      <mrow> 
       <msqrt> 
        <mn>2</mn> 
       </msqrt> 
      </mrow> 
     </math> 
    </informalequation> 
</chapter> 

내가 어떤 도움을 주셔서 감사합니다.

감사합니다.

답변

0

은 첫째로 당신은 너무

<math display='block' xmlns="http://www.w3.org/1998/Math/MathML"> 

가 그럼 난 그냥

 <xs:sequence> 
     <xs:element ref="mml:math" xmlns:mml="http://www.w3.org/1998/Math/MathML"/> 
    </xs:sequence> 

에 의해 <xs:simpleType>을 대체하고 검증 MathML을 이름 [에이스에 배치 할 수 있다고 생각 수학은 MathML을 네임 스페이스에가되고 싶어요 는 MathML 스키마와 연결됩니다.

(하지만 결코 XSD를 사용하지 않습니다. 개인적으로 RelaxNG로 작성하여 번역합니다.)