Error Messages in New Blogger Templates



New Blogger Templates are coded in XHTML which is based on XML. XHTML is a much stricter language than HTML and you will encounter more error messages while working on the new templates...........

USING OLD BLOGGER TEMPLATE. The commonest mistake made is pasting a HTML old blogger template into the Edit Template text box. The error message given when you attempt to Preview or save a HTML template is :

Your template could not be parsed as it is not well-formed. Please make sure all XML elements are closed properly.
XML error message: The content of elements must consist of well-formed character data or markup.

This error message is given because HTML templates are not "well formed". HTML templates are incompatible with the new blogger unless you have chosen to retain the Classic template AFTER migrating to the new Blogger. Going from old blogger to the new blogger is a two step process with the second step being optional. The first step is when the blog is migrated to the new blogger along with the old HTML template also called the Classic Template. The second step is UPGRADATION to the new template as outlined in theIntroduction.




WHEN THERE IS NO MATCHING END TAG : In XHTML every tag should have a matching end tag. If there is a end tag missing you will get the following error message :

Your template could not be parsed as it is not well-formed. Please make sure all XML elements are closed properly.
XML error message: The element type "div" must be terminated by the matching end-tag "

Matching end tags are </div> for <div>.

This error is most frequently seen when adding Metatags. Make sure that all your metatags in the new templates end with a forward slash.
All tags should be closed using a forward slash. If there are empty tags then they should be closed by putting a space before the forward slash. For example : <br />. Empty elements are those not enclosing anything between the opening and closing tags. For example :
<img src="valid.gif" />.



USING THE CHARACTER "&". When using ampersand within an attribute value it should always be written using a m p; (without the spaces) and not simply an & character. If this is not done you will get the following error message :

Your template could not be parsed as it is not well-formed. Please make sure all XML elements are closed properly.
XML error message: The reference to entity "key" must end with the ';' delimiter.

OR THIS

Your template could not be parsed as it is not well-formed. Please make
sure all XML elements are closed properly.
XML error message: The entity name must immediately follow the '&' in
the entity reference. 


For example this is incorrect: <title>Boys & Girls</title> while this is
correct: <title>Boys &a m p; Girls</title>. Omit the spaces between a m p. Do this in links also.




In XHTML, the script and style elements are declared as having #PCDATA content. As a result, < and & will be treated as the start of markup, and entities such as < and &a m p ; will be recognized as entity references by the XML processor to < and & respectively. Wrapping the content of the script or style element within a CDATA marked section avoids the expansion of these entities. The only delimiter that is recognized in a CDATA is the "]]>" string which ends the CDATA section



IF AN ATTRIBUTE IS MISSING. Every attribute must have a value. Every attribute value should be enclosed in double quotes. For example : <table rows="2">. If not you will get following error message :

One of the sections is missing the required id attribute. Every section should have a unique id.



IMPROPERLY NESTING ELEMENTS. (elements must be closed in reverse order). This is incorrect: <em><strong>Include some text.</em></strong>. While this is correct:<em><strong>Include is some text.</strong></em>.



SPECIFY ALTERNATE TEXT FOR IMAGES using the alt attribute. For example : <img src="URL OF IMAGE">ALT. TEXT FOR IMAGE</img>(XHTML 2.0)



CASE MATTERS! In XHTML case matters. If you have <HTML> then you must close it with </HTML>. If instead you close it with </html> you will get the following error :

Your template could not be parsed as it is not well-formed. Please make sure all XML elements are closed properly.
XML error message: The element type "HTML" must be terminated by the matching end-tag "".




VARIABLE DECLARATIONS
 : These variables are used in the Fonts and Colors subtab of the Template tab to enable the blogger to customize the fonts and colors of his template. These variable are defined in the "Variable definitions" part of the template. They are then used in the appropriate css code. For example a variable is defined as :

<variable name="bgColor" description="Page Background Color" type="color" default="#efefef" value="#ffff66">

In that part of the css which describes the body it is used as follows :

body {
background: $bgColor;
}

If you use a variable ($rightSbColor) in the CSS but do not define it in the VARIABLE DEFINITIONS section you will get the following error :

Invalid variable declaration in page skin: Variable is used but not defined. Input: rightSbColor

The solution is to delete the variable or define it in the Variable Definitions section.


SAME WIDGET ID ERROR : If you add a widget or Page Element with the same ID Number as a widget already present in the template you will get the following error :

More than one widget was found with id: LinkList1. Widget IDs should be unique.

To correct the error just change the number in the widget ID. In this case change it to LinkList2.


ADDING CODE BEFORE THE INCLUDABLE : If you add a line of code before the includable line in an expanded widget template you will get the following error :

The widget with id "Blog1" cannot contain element: "b:if". A widget can only contain b:includable elements

To prevent this always add any code after this line <b:includable id='main'> in the widget code.


WIDGETS SHOULD ALWAYS BE WITHIN A SECTION : If you add a widget before the section line in a template you will get the following error :

The widget with id HTML1 is not within a section (actual parent element is: b:if.) Every widget should be in a section.

To prevent this add the widget code after this line in the template :

<b:section class='sidebar' id='sidebar' preferred='yes'>


LINK ERROR : Following error is seen :

Your template could not be parsed as it is not well-formed. Please make
sure all XML elements are closed properly.
XML error message: The value of attribute "href" associated with an
element type "a" must not contain the '<' character.when you have in your template code of this type :

<a href="<data:post.url/>">Read more!</a>

To correct this error change the code to the following :

<a expr:href='data:post.url'>Read more!</a> 


Similarly this code :

<span class="<data:post.author/>">
<data:post.body/>
</span> 

will give this error :

Your template could not be parsed as it is not well-formed. Please
make sure that all XML elements are closed properly.
XML error message: The value of attribute "class" associated with an
element type "span" must not contain the '<' character.

So change it to :

<span class="data:post.author">
<data:post.body/>
</span>


ENCLOSE ATTRIBUTE VALUES IN QUOTES : Attribute values should always be enclosed in quotes otherwise you will get this error :

Your template could not be parsed as it is not well-formed. Please make sure all XML elements are closed properly.
XML error message: Open quote is expected for attribute "width" associated with an element type "img".
Instead of width=56 always use width='56' within code. It does nort matter ehether the quotes are double or single.



DO NOT INCLUDE TWO STYLE SHEETS 
If you include two b:skin tags in the template you wiil get this error


We were unable to save your template
Please correct the error below, and submit your template again.
There should be one and only one skin in the template, and we found: 2

Source: blogdoctor

0 comments:

Post a Comment