XML - Validation Tools
Download a full client XML editor and validator (Exchanger XML Lite from Cladonia):
Check the validity of an HTML or XHTML file on the web:
Check the validity of a CSS style sheet on the web:
Check the "well-formedness" of an XML document on the web:
Check the syntax of a DTD or an XML Schema file on the web:
Check the validity of an XML document using DTD on the web:
<HTML>
<BODY>
<H2>Validate XML document using DTD</H2>
<!-- Enter the URL of the XML document you want to check. -->
<!-- the XML document should contain internally specified DTD. -->
<XML ID="dso" SRC="xyz.xml"></XML>
<SCRIPT LANGUAGE="JavaScript">
doc = dso.XMLDocument;
message = "errorCode: " + doc.parseError.errorCode + "\n"
+ "filepos: " + doc.parseError.filepos + "\n"
+ "line: " + doc.parseError.line + "\n"
+ "linepos: " + doc.parseError.linepos + "\n"
+ "reason: " + doc.parseError.reason + "\n"
+ "srcText: " + doc.parseError.srcText + "\n"
+ "url: " + doc.parseError.url;
alert (message);
</SCRIPT>
</BODY>
</HTML>
Check the validity of an XML document using XML Schema on the web:
<HTML>
<BODY>
<H2>Validate XML document using XML Schema</H2>
<SCRIPT LANGUAGE="JavaScript" >
/* Enter the URL of the XML document */
var XMLFileURL = "xyz.xml";
/* Enter the URL of the XML namespace used, or "" if none is used */
/* if namespace is used enter full url including http://... */
var XMLNamespaceName = "";
/* Enter the URL of the XML Schema */
var SchemaFileURL = "schema.xsd";
doc = new ActiveXObject ("Msxml2.DOMDocument.4.0");
XMLSchemaCache = new ActiveXObject ("Msxml2.XMLSchemaCache.4.0");
XMLSchemaCache.add(XMLNamespaceName, SchemaFileURL);
doc.schemas = XMLSchemaCache;
doc.async = false;
doc.load(XMLFileURL);
message = "error: \t" + doc.parseError.errorCode + "\n"
+ "filepos: \t" + doc.parseError.filepos + "\n"
+ "line: \t" + doc.parseError.line + "\n"
+ "linepos: \t" + doc.parseError.linepos + "\n"
+ "reason: \t" + doc.parseError.reason + "\n"
+ "srcText: \t" + doc.parseError.srcText + "\n"
+ "url: \t" + doc.parseError.url;
alert (message);
</SCRIPT>
</BODY>
</HTML>