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

查看:52
本文介绍了在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天全站免登陆