xml是不是包含html,是否可能在XML属性中包含HTML文本或CDATA?

07002

Before the value of an attribute is passed to the application or checked for validity,the XML processor MUST normalize the attribute value by applying the algorithm below,or by using some other method such that the value passed to the application is the same as that produced by the algorithm.

All line breaks MUST have been normalized on input to #xA as described in 07003,so the rest of this algorithm operates on text normalized in this way.

Begin with a normalized value consisting of the empty string.

For each character,entity reference,or character reference in the unnormalized attribute value,beginning with the first and continuing to the last,do the following:

For a character reference,append the referenced character to the normalized value.

For an entity reference,recursively apply step 3 of this algorithm to the replacement text of the entity.

For a white space character (#x20,#xD,#xA,#x9),append a space character (#x20) to the normalized value.

For another character,append the character to the normalized value.

If the attribute type is not CDATA,then the XML processor MUST further process the normalized attribute value by discarding any leading and trailing space (#x20) characters,and by replacing sequences of space (#x20) characters by a single space (#x20) character.

Note that if the unnormalized attribute value contains a character reference to a white space character other than space (#x20),the normalized value contains the referenced character itself (#xD,#xA or #x9). This contrasts with the case where the unnormalized value contains a white space character (not a reference),which is replaced with a space character (#x20) in the normalized value and also contrasts with the case where the unnormalized value contains an entity reference whose replacement text contains a white space character; being recursively processed,the white space character is replaced with a space character (#x20) in the normalized value.

All attributes for which no declaration has been read SHOULD be treated by a non-validating processor as if declared CDATA.

It is an error if an 07004 contains a 07005 to an entity for which no declaration has been read.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值