การตรวจสอบ DTD
- หน้าก่อน ตัวอย่าง DTD
- หน้าต่อไป ตัวอย่าง DTD
Internet Explorer 5.0 สามารถตรวจสอบ XML ของคุณตาม DTD
การตรวจสอบด้วย XML PARSER
เมื่อคุณพยายามเปิดเอกสาร XML ปัจจุบัน XML พARSER อาจก่อให้เกิดข้อผิดพลาด ด้วยการเข้าถึงตัวแปร 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)
ปิดการเช็ค
โดยการตั้งค่า validateOnParse ของ XML parser ให้เป็น "false" คุณสามารถปิดการเช็ค
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 ที่หน้า
- หน้าก่อน ตัวอย่าง DTD
- หน้าต่อไป ตัวอย่าง DTD