Latest web development tutorials

DTD 검증

Internet Explorer를 사용하여 해당 XML을 확인하기 위해 DTD를 기반으로 할 수 있습니다.


XML 파서 검증

XML 문서를 열려고하면, XML 파서 오류를 생성 할 수 있습니다. parseError 개체에 액세스하면 오류 코드, 텍스트, 심지어 위치의 정확한 원인을 검색 할 수 있습니다.

참고 : load () 메서드는 문자열, loadXML () 메소드 파일을 사용합니다.

var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false";
xmlDoc.validateOnParse="true";
xmlDoc.load("note_dtd_error.xml");

document.write("<br />Error Code: ");
document.write(xmlDoc.parseError.errorCode);
document.write("<br />Error Reason: ");
document.write(xmlDoc.parseError.reason);
document.write("<br />Error Line: ");
document.write(xmlDoc.parseError.line);

»시도

보기 XML 파일


확인 닫기

XML 파서 validateOnParse가 "거짓"으로 설정하여 유효성 검사를 해제 할 수 있습니다.

var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false";
xmlDoc.validateOnParse="false";
xmlDoc.load("note_dtd_error.xml");

document.write("<br />Error Code: ");
document.write(xmlDoc.parseError.errorCode);
document.write("<br />Error Reason: ");
document.write(xmlDoc.parseError.reason);
document.write("<br />Error Line: ");
document.write(xmlDoc.parseError.line);

»시도


범용 XML 검사기

우리가이 만든 XML 파일을 확인할 수 있도록 링크를 어떤 XML 파일의 유효성을 검사 할 수 있습니다.


parseError 개체

당신은 우리의 수 "XML DOM 튜토리얼" parseError 개체에 대해 자세히 알아보십시오.