Jump to content

Recommended Posts

I have the script:

http://pastie.org/private/1stlhb73iduiztx98ybhkw

 

I'm trying to upload it to Blogger as html....but instead I keep receiving this error.

 

We were unable to save your template

 

Please correct the error below and submit your template again.

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 element type "script" must be terminated by the matching end-tag "".

 

 

Could anyone tell me what I have to do, to fix this error?

 

Thanks for taking the time to read my problem :)

Link to comment
https://forums.phpfreaks.com/topic/240795-simple-facebook-script-error/
Share on other sites

On line 8 it says:

 


<script type="text/javascript">

 

Normally, that is the beginning of a piece of script (mostly Javascript) in another language. The end of such a script must be:

 


</script>

 

If not, you get an error like you did.

I took the liberty of pasting the relevant code here, so its a little bit easier to reference the problem

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" lang="en">
    <meta property="og:title" content="[TEXT]">
    <meta property="og:url" content="http://[YOURURL].blogspot.com/">
    <meta property="og:image" content="[FB IMAGE]">
    <meta property="og:site_name" content="">
    <meta property="og:description" content="[TEXT 2]">
The error is here:<script type="text/javascript">
<!--
You never close this tag. There isn't even any javascript here. 
I'm not sure why you even have this opening javascript tag, 
since you aren't including any separate source code files here. 
Two seperate fixes below
-->
     
     
     
     <style type="text/css">body{font-family:"Lucida Grande", Tahwitoma;font-size:11px;}p{margin:0;padding:0;}a{color:#3b5998; cursor:pointer;}a:hover{text-decoration:underline;}a.viewmore{display:block;height:29px;border:1px solid #d8dfea;background-color:#edeff4;text-align:center;line-height:29px;}a.viewmore:hover{background-color:#d8dfea;}</style><link rel="openid.server" href="http://www.blogger.com/openid-server.g" />
    <!-- --><style type="text/css">@import url(http://www.blogger.com/static/v1/v-css/navbar/697174003-classic.css);
    div.b-mobile {display:none;}
    </style>
     
    </head>

... rest of code

 

the error is highlighted and explained. Two fixes below

<script type="text/javascript"></script>

That adds the closing tag after the opening tag. Kind of dumb though because there is no javascript code, so you might as well just take out that script tag entirely.

I tried adding the </script> tag directly after it, AND deleting    <script type="text/javascript"> all together and the same error;

 

We were unable to save your template

 

Please correct the error below and submit your template again.

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 element type "meta" must be terminated by the matching end-tag "".

 

 

Comes up :(

Thats a different error from your first one. Notice

The element type "meta" must be terminated by the matching end-tag "".

 

In your OP, the element type was "script". It seems you have a bunch of meta tags that are unclosed too. Now they seem fine to me for most normal pages, but the XML parser you are uploading or whatever that file to may only accept strict xhtml. so you may have to use self closing tag syntax. Self closing syntax is akin to the following

<img src="someImage.jpg" />

notice the forward slash before the closing >.

 

For your code, there seem to be many meta tags missing this. The first one should look like

<meta property="og:title" content="[TEXT]" />

 

 

I can't really guarantee this will work because I haven't really looked through the rest of your code. You may have invalid HTML elsewhere. The error messages are pretty descriptive though.

 

The element type "meta" must be terminated by the matching end-tag "".

 

Element type refers to the tag. So when it says element type "meta" its referring to meta tags. If it were to say for example, element type "img" it would be referring to the img tags. The rest is pretty self explanatory.

Thanks for your help :)

 

I think that fixed one issue but now I have this one:

 

"We were unable to save your template

 

Please correct the error below and submit your template again.

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 element type "html" must be terminated by the matching end-tag ""."

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.