This test runs an XML parser on your document to check if your page validates against its specified schema. A schema (or DTD) constrains the structure and content of an XML document. An XML document which is well-formed and which complies with its schema is said to be valid. Put simply, the schema specifies rules about the structure and content of a document, and your document must follow these rules (as well as general XML well-formedness rules). If the XML parser finds something wrong with your document, then an error message will be displayed. Some errors cause the parser to stop dead in its tracks, while some errors are not so serious, and the parser can continue.
Understanding the validator error messages
The output of the validator can sometimes be misleading. A list of the most common messages and their remedies are included below:
The content of element type "body" must match…
The content of element type "form" must match…
The reference to entity "&" must end with the ';' delimiter.
Attribute "attr" must be declared for element type "element".
Element type "element" must be declared.
White spaces are required between publicId and systemId.
The system identifier must begin with either a single or double quote character.
Content is not allowed in prolog.
The processing instruction target matching "[xX][mM][lL]" is not allowed.
XML document structures must start and end within the same entity.
The element type "element" must be terminated by the matching end-tag "</element>".
The processing instruction must begin with the name of the target.
Open quote is expected for attribute "attr" associated with an element type "element".
The content of element type "body" must match "(h1|h2|h3|h4|h5|h6|ul|ol|dl|p|div|pre|blockquote|address|hr|table|form|fieldset)*".
Cause:
Only certain tags are allowed immediately after the <body> tag
Solution: This message indicates that markup immediately following the tag should be one of the tags in the list e.g.
Incorrect:
1 2 3 |
<body> Hello World! </body> |
Correct:
1 2 3 4 5 |
<body> <p> Hello World! </p> </body> |
The content of element type "form" must match "(h1|h2|h3|h4|h5|h6|ul|ol|dl|p|div|pre|blockquote|address|hr|table|fieldset)+".
Cause: Only certain tags are allowed immediately after the <form>
tag
Solution: This message is very similar to the previous one. Markup immediately following the <form>
tag should be one of the tags in the list:
The reference to entity "&" must end with the ';' delimiter.
Cause: This message is often displayed where the '&' characters in a URL have not been converted to their corresponding XML entity.
Solution: Escape special characters such as '&'
Correct:
1 |
<a href="http://example.mobi?fname=joe&lname=blogs">...</a> |
Incorrect:
1 |
<a href="http://example.mobi?fname=joe&lname=blogs">...</a> |
Attribute "attr_name" must be declared for element type "element_name".
Cause:
This type of message simply means that you may not include attribute attr_name for the element element_name.
Solution: To fix the problem, simply omit the offending attribute: e.g. if you receive the message:
Attribute "name" must be declared for element type "form".
Remove the name attribute e.g.
1 |
<form name="myform" id="myform" ...> |
becomes
13 Comments
I need help with this section. I can’t understand whats going on. With my site.
Jaarzu
Love Gadgets
at MobiRadi.Mobi
I need help with my Mobi Site it seems like theres a problem with go daddy.com I found 2 fails XHTML Mobile Profile and Valid Markup. I haven’t even put my web banner on the site yet. Im trying to figure out where the Script would be or how do I edit the Source Code. I been trying to fix this for Months Now. I really need to Launch my site. Go daddy is not a good company to get a dotMobi.
Jaarzu
Love Gadgets
at MobiRadi.Mobi
I got a 4 on mobiReady tester page result site and I just have little writing on my mobi site. I don’t understand need help Thanks.
Jaarzu
Love Gadgets
at MobiRadi.Mobi
Hi, I’ve been going crazy trying to figure out why I get Invalid Markup and XHTML Mobile Profile errors. I have no specific code errors and I validate fine on W3C’s MobileOK. I’m even using the DOCTYPE declaration example from W3C.
Here’s what I get:
FAIL near line -1 column -1
Your page does not validate against XHTML Basic 1.1 or XHTML Mobile Profile 1.2
The site is an adult site so I won’t post it up here, but is there any way I can help on this I don’t see any issue on my end so this is very confusing.
Much appreciated.
Just to update my last post. I figured it out. I changed DOCTYPE from XHTML MP 1.2 to Basic XHTML. after alot of research it turns out there are problems validating DOCTYPES that point to openmobilealliance.org. This really sucks as I wanted to use the MP version however I will stick to Basic XHTML doctype since it gives me a nice 5.
So to summarize. If you are using the following DOCTYPEs they will not validate properly with ready.mobi:
[code]
[/code]
You may try using XHTML Basic DOCTYPE instead for now.
hi guys im very very new to XML and DTD’s im trying to work through a work sheet and i have to validate my XML file which includes an internal DTD
the worksheet wanted me to create a DTD and should assume that all occurring attributes are mandatory, have i done this right? and can you please help me fix the error thank you
below is the validation error what does this mean:
1 ERROR FOUND:
26: 14 The content of element type “teaching” must match “(course)”.
XML document:XML and the Web
[code]
1
2
4
5
6
7
8
9
10
11
12
13
14
15
16
17 ]>
18
19
20
21
22
23
24 Web Server Architectures
25
26
27
28 The application of Web protocols to Biology
29
30
31
32
[/code]