• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 22. XML and XSLT > Validating XML Documents

Validating XML Documents

As mentioned in the beginning of this chapter, you can specify the syntax of an XML document yourself. You can do that typically with a DTD or an XML schema (which we won’t cover here; see www.w3.org/TR/xmlschema-0/ for more information). The Internet Explorer does try to validate XML documents as it loads them, checking them against the syntax you’ve specified; but you won’t see any validation errors unless you check the parseError object. Let’s take a look at how that works.

Tip

You can also turn validation on or off with the document object’s validateOnParse property. This property is set to true by default, but if you set it to false, validation is turned off.



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint