在 XML 模式中强制使用 CDATA [英] Force use of CDATA in XML-schema

查看:28
本文介绍了在 XML 模式中强制使用 CDATA的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个 xml 架构,并且我想确保所有元素中的值是 CDATA 元素.

I am creating an xml schema, and I want to make sure that the values in all the elements are CDATA elements.

有没有办法使用 XML 模式强制执行此操作?

Is there a way to force this using XML-schema?

推荐答案

我记得 XML Schema 在 XML Infoset 上工作,这意味着在解析 XML 文档后,实体被解析,空白被规范化并处理 CDATA.CDATA 是一种简化文本序列化的方法,而不是结构模型的一部分.所以:不.在 DTD 或 RELAX NG 中都没有.

As I recall XML Schema works on the XML Infoset, meaning with the XML document after it is parsed, entities are resolved, whitespace is normalised and CDATA is processed. CDATA is a way of easing the textual serialization not a part of the structural model. So: No. Neither in DTDs or RELAX NG.

这篇关于在 XML 模式中强制使用 CDATA的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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