如何为打印机语言创建DTD(文档类型定义)? [英] How to create DTD(document type definition) for printer language?

查看:53
本文介绍了如何为打印机语言创建DTD(文档类型定义)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为数据矩阵打印机语言创建DTD(文档类型定义)。我想定义条形码,线条,方框,x轴,y轴位置等内容。任何人都可以帮忙吗?

I want to create DTD(document type definition) for data matrix printer language. I want to define contents like barcode, line, box, x-axis, y-axis position etc. Can anyone help?

推荐答案

这不是一个真正的问题。答案是:学习XML并实现你想要的一切。你没有解释任何特别关注的问题。你没有告诉我们你的语言设计,要求,没有任何相关信息。



请参阅:

http://www.w3.org/TR/REC-xml [ ^ ],

http://www.w3.org/TR/REC-xml/#sec-prolog-dtd [ ^ ],

http://www.w3.org/TR/REC-xml/#sec-rmd [ ^ ],

http://www.w3.org/XML/1998/06/xmlspec-report- v21.htm [ ^ ]。



但我有另一个想法。有一种更新的方式来描述XML 元数据 XML Schema

http://en.wikipedia.org/wiki/XML_Schema_(W3C) [ ^ ],

http://www.w3.org/standards/xml/schema [ ^ ]。



坦率地说,DOCTYPE是一种丑陋的语言,有很多限制。它在W3标准中的描述很难完美。找到一个好的DOCTYPE解析器很难或几乎不可能;这可能是因为它的使用是有限的。



与此相反,XML模式本身是用XML编写的,因此它可以被许多不同的工具解析;其中一些是语义感知的。有足够的模式验证工具(根据模式验证XML)。架构具有更好的表现力,更灵活。



-SA
This is not really a question. The answer would be: learn XML and implement all you want. You did not explain any particular concerns. You did not tell us anything about your language design, requirements, nothing like that.

Please see:
http://www.w3.org/TR/REC-xml[^],
http://www.w3.org/TR/REC-xml/#sec-prolog-dtd[^],
http://www.w3.org/TR/REC-xml/#sec-rmd[^],
http://www.w3.org/XML/1998/06/xmlspec-report-v21.htm[^].

But I have another idea. There is a newer way of describing the XML metadata, XML Schema:
http://en.wikipedia.org/wiki/XML_Schema_(W3C)[^],
http://www.w3.org/standards/xml/schema[^].

Frankly, DOCTYPE is ugly language with a lot of limitations. Its description in W3 standards is hard from perfect. It's hard or almost impossible to find a good DOCTYPE parser; and this is probably because its use is limited.

In contrast to that, XML schema is itself written in XML, so it can be parsed by many different tools; some of them are semantic-aware. There are enough of schema validation tools (validating XML against the schema). And the schema has much better expressive power, is much more flexible.

—SA


这篇关于如何为打印机语言创建DTD(文档类型定义)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆