Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 173
  • Last Modified:

How can i validate a html document for html syantax checking and css checking?

How can i validate a html document for html syantax checking and css checking?
0
sunil_6
Asked:
sunil_6
  • 2
  • 2
1 Solution
 
fds_fatboyCommented:
I would suggest you create the document using xhtml and use  MSXML4.dll to parse it.
0
 
sgayatriCommented:
There is no tool except for your web browser for html syntax checking. If the html syntax is ok, then the page is displayed as per expectation, if there is any syntax error, the erroneous lines are ignored and the remaining page is displayed.
0
 
sunil_6Author Commented:
From where i will get MSXML4.dll
0
 
sunil_6Author Commented:
Can you give me some sample code to validate a html page
0
 
fds_fatboyCommented:
Download it from here:
http://msdn.microsoft.com/XML/XMLDownloads/default.aspx

Sorry I have no sample code for xhtml, but the general idea is that you instatiate an XML DOM document object, load the xhtml schema into the schemas collection and then attempt to load the xhtml. This will then be parsed and if it fails, the load will fail. The parse error will then be available as a property of the DOM document.

I hope this helps.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now