在 php 中验证 DITA

发布于 2024-09-18 05:35:05 字数 155 浏览 4 评论 0原文

如果我想根据 DTD 或 XSD 获取标签中允许的属性,或者 DITA XML 文档特定部分中允许的标签,我应该使用什么 php 库?

我已经用 XML_DTD-0.5.2 pear lib 尝试过,但它似乎解析官方 1.1 和 1.2 DITA dtds 有很多错误......

What php library should I use if I want to get the allowable attributes in a tag, or the allowable tags in a specific part of a DITA XML document, according to it's DTD or XSD?

I've tried it with the XML_DTD-0.5.2 pear lib, but it seems it parses the offical 1.1 and 1.2 DITA dtds with many errors...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

渔村楼浪 2024-09-25 05:35:05

使用 DOM 或 XMLReader,然后使用它们各自的方法根据架构验证 XML:

或者直接使用这些库加载架构。由于 Schema 也是 XML,因此您可以像处理任何其他 XML 一样处理它,例如找出为元素定义了哪些属性。

Use DOM or XMLReader and then use their respective methods to validate XML against a schema:

Or simply load the Schema directly with these libraries. Since Schema is XML too you can process it like any other XML, e.g. find out what attributes are defined for an element.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文