XSD在DITA主题之上添加新元素。我必须参考哪个DITA XSD?

问题描述 投票:0回答:1

由于客户的要求,我需要生成一个新的XSD架构来验证向DITA主题文档添加一些信息的XML文档。或多或少的想法是拥有以下内容:

<?xml version="1.0" encoding="UTF-8"?>
<customdocument>
  <custommetadata>
  ...
  </custommetadata>
  <topic>
   <!-- Here it comes a complete valid DITA topic -->
  </topic>
</customdocument>

我对XSD的建议如下:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns="http://myNamespace"
    targetNamespace="http://myNamespace"
    elementFormDefault="qualified">
    <xs:include schemaLocation="MetaInfo.xsd"></xs:include>
    <xs:include schemaLocation=".\dita-v1.3-os\part3-all-inclusive\all-inclusive-grammars\schema-url\base\xsd\basetopic.xsd"></xs:include>
    <xs:element name="customerdocument" type="customerdocumentType"></xs:element>
    <xs:complexType name="customerdocumentType">
        <xs:sequence>
            <xs:element ref="custommetadata" minOccurs="1"></xs:element>
            <xs:element ref="topic" minOccurs="1"></xs:element>
        </xs:sequence>
    </xs:complexType>
</xs:schema>

custommetadata元素来自已定义的XSD(MetaInfo.xsd)。另一方面,topic元素来自\dita-v1.3-os\part3-all-inclusive\all-inclusive-grammars\schema-url\base\xsd\basetopic.xsd(我认为它是DITA主题验证的根XSD)。

我试图验证一些文档,包括简单的DITA主题,它工作正常。但是,对于包括<uicontrol>元素在内的更复杂的DITA主题,验证失败。

Engine name: Xerces
Severity: error
Description: cvc-complex-type.2.4.a: Invalid content was found starting with element 'uicontrol'. One of '{dl, div, fig, imagemap, image, lines, lq, note, hazardstatement, object, ol, pre, simpletable, sl, table, ul, boolean, cite, keyword, ph, b, i, line-through, overline, sup, sub, tt, u, q, term, text, tm, xref, state, data, sort-as, data-about, foreign, unknown, draft-comment, fn, indextermref, indexterm, required-cleanup}' is expected.
Start location: 12:22
End location: 12:31
URL: http://www.w3.org/TR/xmlschema-1/#cvc-complex-type

所以问题是,引用的XSD是否是验证DITA主题的正确入口点? DITA规范1.3包含大约153个XSD文件。

一些帮助将非常感激。

xml xsd dita
1个回答
1
投票

您应该尝试在“schema \ technicalContent \ xsd \ topic.xsd”中使用open。

© www.soinside.com 2019 - 2024. All rights reserved.