XML xml 특수 문자 파싱 (xmlParseEntityRef: no name)
페이지 정보
본문
This page contains the following errors:
error on line 19 at column 23: xmlParseEntityRef: no name
Below is a rendering of the page up to the first error.
xml파일에 "&"이나 "<", ">" 와 같이 특수문자가 있으면 “xmlParseEntityRef: noname” 오류 발생합니다.
Solution 1 : Remove the ampersand.
Solution 2 : Encode the ampersand (that is replace the '&' character with '& amp;' ). Remember to Decode when reading the XML text.
replace the ampersand ( '&') character with '&' . '<' with '<' and '>' with '>'
strip_tags(preg_replace("/&(?!#?[a-z0-9]+;)/", "&",$textorhtml));
Solution 3 : Use CDATA sections (text inside a CDATA section will be ignored by the parser.) eg.
<![CDATA[
{XML DATA}
]]>
참고자료
https://blog.naver.com/qortmdgms/220223461806
https://stackoverflow.com/questions/7604436/xmlparseentityref-no-name-warnings-while-loading-xml-into-a-php-file
error on line 19 at column 23: xmlParseEntityRef: no name
Below is a rendering of the page up to the first error.
xml파일에 "&"이나 "<", ">" 와 같이 특수문자가 있으면 “xmlParseEntityRef: noname” 오류 발생합니다.
Solution 1 : Remove the ampersand.
Solution 2 : Encode the ampersand (that is replace the '&' character with '& amp;' ). Remember to Decode when reading the XML text.
replace the ampersand ( '&') character with '&' . '<' with '<' and '>' with '>'
strip_tags(preg_replace("/&(?!#?[a-z0-9]+;)/", "&",$textorhtml));
Solution 3 : Use CDATA sections (text inside a CDATA section will be ignored by the parser.) eg.
<![CDATA[
{XML DATA}
]]>
참고자료
https://blog.naver.com/qortmdgms/220223461806
https://stackoverflow.com/questions/7604436/xmlparseentityref-no-name-warnings-while-loading-xml-into-a-php-file
댓글목록
등록된 댓글이 없습니다.