简体   繁体   English

如何验证Dita文件

[英]How to validate dita document

I would like to validate different DITA documents (topics, maps, etc.) against DITA but i am a bit confused about the DITA xsd files. 我想针对DITA验证不同的DITA文档(主题,地图等),但是我对DITA xsd文件有些困惑。 The xsd package contains a lot of xsd files in different directories. xsd软件包在不同目录中包含许多xsd文件。 A lot of the files define the same elements, groups (without redefine, for example attribute group domains-att). 许多文件定义了相同的元素,组(没有重新定义,例如属性组domains-att)。

So i guess there is a "main" xsd file (sub set of all the xsd files) for every type of DITA document. 所以我想每种类型的DITA文档都有一个“主要” xsd文件(所有xsd文件的子集)。 Is that true and if yes, what are the main files? 是真的,如果是,主要文件是什么? If it is not true, could you please tell me how validation of a DITA document works if there are multiple definitions of the same types. 如果不是,请告诉我如果存在多个相同类型的定义,那么DITA文档的验证如何工作。

You may find my DITA specialization tutorials useful as an introduction to DITA grammar design: 您可能会发现我的DITA专业化教程对于DITA语法设计的介绍很有用:

http://dita4practitioners.github.io/dita-specialization-tutorials/ http://dita4practitioners.github.io/dita-specialization-tutorials/

The tutorials focus on DTD syntax because that's what most DITA users use, but there is an XSD document type shell tutorial, which is directly relevant to your question here: 这些教程专注于DTD语法,因为大多数DITA用户都使用DTD语法,但是这里有一个XSD文档类型shell教程,它与您的问题直接相关:

http://dita4practitioners.github.io/dita-specialization-tutorials/body/part-config-and-extend/tutorials/document-type-shells/creating-an-xsd-shell.html http://dita4practitioners.github.io/dita-specialization-tutorials/body/part-config-and-extend/tutorials/document-type-shells/creating-an-xsd-shell.html

Eliot 艾略特

每个主题类型的主要XSD文件都命名为<topic type name>.xsd ,例如topic.xsdconcept.xsdmap.xsd

Proper validation of CALS tables within DITA poses additional problems due to co-constraints that XSD (at least in 1.0 form) can't express. 由于XSD(至少以1.0格式)无法表达的协同约束,DITA中对CALS表的正确验证带来了其他问题。

If you're Ok with using Schematron, there's a cals-table-schematron defintion that handles this. 如果您可以使用Schematron 很好 ,那么可以使用cals-table-schematron定义来解决这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM