Логин:

Пароль:

Форумы
Общие вопросы
Document Object Model
Обсуждаем конференцию
Web Usability (test)

Общие вопросы

CDATA в xml

>> Attribute values require quotation marks.
>> Values for attributes must be in single or double quotation marks. For example, without XML validation, you can specify language=JScript in a <script> element. But to follow XML rules, the same attribute would be language="JScript".
>>
>> Reserved characters in script elements must be made opaque.
>> Script elements frequently include greater than (<) and less than (>) symbols, the ampersand symbol (&), and other characters that are reserved in XML. If you are creating a closely conformant XML file, you must make sure that these reserved characters do not confuse the XML parser. You can individually mark characters with escape sequences (for example, specify "<" as "<"), or you can make an entire script element opaque by enclosing it in a <![CDATA[ ...]]> section. Without XML validation, the script component XML parser treats <script> elements as opaque by default.
>

предыдущий был я . не читайте... тут у меня все lt и gt заменились......
sorry
еще раз.

Да это все понятно. Читал спецификации...
Я вот о чем.
пишу что-нить типа (например):

<script language="JavaScript">
<![CDATA[
var str = '<br>';
]]>
</script>

получаю :

<script language="JavaScript">
var str = '<br>';
</script>

тут все нормально...
а вот если пишу

<![CDATA[
<script language="JavaScript">
var str = '<br>';
</script>
]]>

то получаю

&amp;lt;script language="JavaScript"&amp;gt;
var str = '&amp;lt;br&amp;gt';
&amp;lt;/script&amp;gt;

почему он мне тут похерил < и > внутри CDATA, а в предыдущем примере - нет ?
СообщениеАвторДата
Cuthbert05.03.2003 18:04
Dim05.03.2003 18:20
Гость05.03.2003 23:26
Cuthbert05.03.2003 23:30
Leechy06.03.2003 14:03
Cuthbert06.03.2003 15:18