XML Tags
| Composed of: | ||
| Prolog |
|
|
| Connecting |
set xml = Server.CreateObject("Microsoft.XMLDOM") xml.async = false xml.load(Server.MapPath("data.xml")) set xsl = Server.CreateObject("Microsoft.XMLDOM") xsl.async = false xsl.load(Server.MapPath("data.xsl")) Response.Write(xml.transformNode(xsl)) %> |
|
| Elements | Can be html or your own tags that you name | |
| Attributes | Describe the tags you set up | |
| URL | hyperlinks here | |
| Comments |
|
|
| Processing Instructions | <?target ....instructions..... ?>
|
|
| Markup characters must be properly escaped | String Literals--Entity References -- CDATA section |
|
| Unicode specs --Character References |
used to substitute characters that violate the syntax rules (like the & character) in your tags |
|
| Notation | **** Only in Attributes non XML data (like applications and binary image data) |
|
| To verify your data: | |
| Type | Link |
| DTD |
<!DOCTYPE DOCUMENT SYSTEM "data.dtd"> |
| Schema |
<products xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns='schema.xsd'> |
| namespace tags |
can be inline anywhere on your document --used with various schemas |
| Standalone |
no DTD or schema needed <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
Validating with the XML Parser
If you try to open an XML document, the XML Parser might generate an error.
By accessing the parseError object, the exact error code, the error text, and
even the line that caused the error can be retrieved:
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)
Turning Validation off
Validation can be turned off by setting the XML parser's validateOnParse="false