CDATA(Character data) : 캐릭터 데이터.
In XHTML, the script and style elements are declared as having
#PCDATA
content. As a result, <
and &
will be treated as the start of markup, and entities such as <
and &
will be recognized as entity references by the XML processor to <
and &
respectively. Wrapping the content of the script or style element within a CDATA
marked section avoids the expansion of these entities.<script> <![CDATA[ ... unescaped script content ... ]]> </script>
CDATA
sections are recognized by the XML processor and appear as nodes in the Document Object Model, see Section 1.3 of the DOM Level 1 Recommendation [DOM].
An alternative is to use external script and style documents.
XHTML에서 스크립트와 스타일 요소는 PCDATA를 포함한 내용에 의해 선언된다. 결과적으로
<
와 &
는 마크업의 시작으로서 처리될 것이다. 그리고 <
와 &
같은 엔티티들은 XML 프로세서에 의해 엔티티 참조객체에서 각각 <
와 &
로 간주 될 것이다.스크립트와 스타일 요소의 내용을 CDATA로 마크된 섹션내에 감싸는 것은 이러한 엔티티의 확장을 막는다.
CDATA 섹션들은 XML 프로세서에 의해 인지된다. 그리고 DOM에서 노드로서 나타난다. 대안법은 확장된 스크립트와 스타일 문서를 사용하는 것이다.
댓글 없음 :
댓글 쓰기