RSS
Write some words about you and your blog here

Difference - HTML and XHTML

When inserting codes into the Blogger template, page element, or blog post, you may have seen error messages that the code could not be parsed, was not well-formed, was broken, or that the elements were not closed properly. These errors can be corrected if you understand the rules that must be adhered to in XHTML documents. Blogger templates use the XHTML 1.0 Strict Document Type. In this article, we shall explain some of the XHTML syntax or rules, so that you may troubleshoot and resolve the problems if these error messages should occur.

XML, HTML and XHTML

We shall keep this short. Just so as you understand what we said about document type, view the Page Source or Source of your Blogger blog. You should see this document type declaration at the very top:-

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">


The terms – XML, HTML and XHTML - refer to the markup language used to write the web pages. Many of us would have heard of HTML (Hypertext Markup Language), invented by Tim Berners-Lee, and used since the early days of internet. XML (Extensible Markup Language) is a meta-language, used to create other markup languages. The traditional HTML was later recast to use the rules of XML and that resulted in a new XML application, called XHTML (Extensible Hypertext Markup Language). Because XHTML rules are strict and unforgiving, not conforming to them when attempting to modify the template would result in error messages. So, what are these rules that Bloggers like us should take note of?

Basic Rules of XHTML

1. Codes to be in lowercase

Since XML is case sensitive, all the element keywords and attribute names used in XHTML should be in the lowercase. For example, the template code is not this:-

<TITLE>Tips for New Bloggers</TITLE>


but this:-

<title>Tips for New Bloggers</title>


If you have noticed, the elements and attribute names between the lesser than (<) and greater than (>) signs have to be in the lowercase. However, the value, which in this case is “Tips for New Bloggers”, can be in the uppercase, lowercase, or mixed case.

2. Attribute values to be in quotation marks

All the attribute values have to be enclosed either in single or double quotation marks. The following examples are not accepted by XHTML:-

<div id=header-wrapper>

<a href=http://tips-for-new-bloggers.blogspot.com>Text Link</a>

<img src=photo.jpg/>

<table width=200 border=0 cellpadding=2>


Instead, they should be written as such:-

<div id='header-wrapper'>

<a href="http://tips-for-new-bloggers.blogspot.com">Text Link</a>

<img src="photo.jpg"/>

<table width="200" border="0" cellpadding="2">


3. Container elements must have closing tags

This is not correct:-

<p>A paragraph.


In XHTML, there must be a closing tag with a forward slash (/) at the end:-

<p>A paragraph.</p>


Examples of the many non-empty elements that have opening and corresponding closing tags are:-

<ul> ... </ul>
<li> ... </li>
<table> ... </table>
<h2> ... </h2>
<div> ... </div>
<span> ... </span>
<dt> ... </dt>
<dd> ... </dd>
<a href> ... </a>


4. Standalone elements to be closed

Some of the elements are empty or standalone. They do not have associated closing tags. Common examples are:-

<br>
<img>
<input>
<frame>
<hr>
<meta>
<link>


Nonetheless, in XHTML, these elements must be terminated or closed. There are two ways to do that. One way to terminate the element is to put a forward slash (/) at the end like this:-

<br/>
<img/>
<input/>
<frame/>
<hr/>
<meta/>
<link/>


The second way is to add a corresponding closing tag like this:-

<br> ... </br>
<img> ... </img>
<input> ... </input>
<frame> ... </frame>
<hr> ... </hr>
<meta> ... </meta>
<link> ... </link>


5. Elements to be properly nested

This means that elements must be closed in the reverse order. For example, this code is not accepted in XHTML:-

<form><table> ... </form></table>


It is improperly nested because the form was created first followed by the table. To close them in the proper order, the table must be closed before the form, like this:-

<form><table> ... </table></form>


6. Document to have only one root element

In the XHTML document, you will see that except for the document type declaration, all the codes are nested between <html> and </html>. This is the root element and all other elements or sub elements are in between. The document structure will look like this:-

<html>
<head> ... </head>
<body> ... </body>
</html>


7. Attribute minimization is not allowed

In XHTML, all attributes should be in the form name="value". Even if the value is the same as the name, it cannot be minimized to one word. Hence, in our Add Text Box and Textarea article, the textarea code is not this:-

<textarea readonly>Hyperlink Code</textarea>


but this:-

<textarea readonly="readonly">Hyperlink Code</textarea>


XHTML Character Entities

Quite a number of readers had asked why they were unable to display HTML codes in their blog posts or why their codes were not well-parsed when inserted into the template. If you have noticed by now, the codes are wrapped in the lesser than (<) and greater than (>) signs. The moment these are posted, they will be interpreted as codes and will trigger an action by the browser. Should you want to display these as part of the text, use their character entities instead.

"&quot;
&&amp;
<&lt;
>&gt;


The next time you see an error message to the effect that the code is not well formed, not well parsed, not properly closed, etc., take a look at this guide, troubleshoot the problem and try out the possible solutions.

How to add a searchbox to Blogger

I found this on Tips for New Bloggers
Put this code in a HTML/JavaScript widget:

<p align="left">
<form id="searchthis" action="http://your_blog_url/search" style="display:inline;" method="get">
<strong>The_Searchbox_Title<br/></strong>
<input id="b-query" maxlength="255" name="q" size="20" type="text"/>
<input id="b-searchbtn" value="Search" type="submit"/>
</form></p>


Replace your_blog_url with the url of your blog
(eg: "http://cnvproductions.blogspot.com/search")
Replace The_Searchbox_Title with something

add digg button to blogger or blogspot

This is a step-by-step guide to automatically place a real-time Digg count and vote button to every single blog post. Digg is a social content website where your readers or you can submit content to. If you have a good story, members will 'digg' the post and write comments. As a blog owner, you may want to make it easy for and encourage your readers to submit and digg your articles.

Automatic Count and Vote Button

Before you do that though, you would want to take note of the following:-

1. Your blog should be set to save Post Pages. Post Pages are archived blog posts published to their own web page. Each post will have a unique URL, which is required by Digg for the individual posts to be submitted. To verify or enable it, login to your Blogger Dashboard. Under Settings-> Archiving, set the “Enable Post Pages?” to “Yes” and save the settings.

2. This template hack will put a Digg button to every post. You are therefore not able to choose which post you want to include or exclude a button. If you would prefer to have a Digg button added only to some posts, read the later part of this article on “Button for selective posts.”

3. The code reads the URL of the individual blog page and this shall be the URL used for submission of the story to Digg.

Under “Template”, click the “Edit HTML” tab. Block copy the entire HTML code for your site and save it in a text file. You can also click the "Download Template" link. This is one of the two necessary steps whenever you want to change the template. The second step is of course to “Preview” the new changes, and save the changes only when you are satisfied. The backup you have saved in a text file will come in handy when you accidentally click to save the changes without previewing them. With a backup, you can easily restore the template to the prior state if need be.

Add Digg button to Blogger or Blogspot

Click the box next to “Expand Widget Templates”. Scroll about two-thirds down the template to look for the code that reads:-

<p><data:post.body/></p>




If you want the button to show at the top right corner of your post, replace the above code with this.

<div style='float:right; margin-left:10px;'>
<script type='text/javascript'>
digg_url=&quot;<data:post.url/>&quot;;
</script>
<script src='http://digg.com/tools/diggthis.js' type='text/javascript'/>
</div>
<p><data:post.body/></p>


This is what you get:-

Add Digg button to Blogger or Blogspot

If you would like the button to appear at the end of your post, replace with this following code instead.

<p><data:post.body/></p>
<div style='float:right; margin-left:10px;'>
<script type='text/javascript'>
digg_url=&quot;<data:post.url/>&quot;;
</script>
<script src='http://digg.com/tools/diggthis.js' type='text/javascript'/>
</div>


The result will be this:-

Add Digg button to Blogger or Blogspot

If you want to have the button at the top left corner of your post, change the alignment.

<div style='float:left; margin-right:10px;'>
<script type='text/javascript'>
digg_url=&quot;<data:post.url/>&quot;;
</script>
<script src='http://digg.com/tools/diggthis.js' type='text/javascript'/>
</div>
<p><data:post.body/></p>


The outcome is this:-

Add Digg button to Blogger or Blogspot

Digg has another compact button. If you insert this code:-


<div style='float:right; margin-left:10px;'>
<script type='text/javascript'>
digg_url=&quot;<data:post.url/>&quot;;
digg_skin=&quot;compact&quot;;
</script>
<script src='http://digg.com/tools/diggthis.js' type='text/javascript'/>
</div>
<p><data:post.body/></p>


You will see a compact Digg count button like this:-

Add Digg button to Blogger or Blogspot

You can also change the background color of the button to blend with your site. For example, a code like this:-


<div style='float:right; margin-left:10px;'>
<script type='text/javascript'>
digg_url=&quot;<data:post.url/>&quot;;
digg_bgcolor=&quot;#BDEDFF&quot;;
digg_skin=&quot;compact&quot;;
</script>
<script src='http://digg.com/tools/diggthis.js' type='text/javascript'/>
</div>
<p><data:post.body/></p>


will give you this:-

Add Digg button to Blogger or Blogspot

You can insert the color code of your choice into the red portion. For a list of color values to insert, you may refer to the Hexadecimal HTML color code list.

Automatic Count Button in Blog Footer

[Update] This segment is added in response to user's request to have the Digg button in the Blog footer, i.e., after the labels. If you scroll through your template, you will see this chunk of code which gives the labels in your Blog footer.

<p class='post-footer-line post-footer-line-2'>
<span class='post-labels'>
<b:if cond='data:post.labels'>
<data:postLabelsLabel/>
<b:loop values='data:post.labels' var='label'>
<a expr:href='data:label.url' rel='tag'><data:label.name/></a><b:if cond='data:label.isLast != "true"'>,</b:if>
</b:loop>
</b:if>
</span>
</p>


If you want a Digg button to appear just after the labels, add the appropriate Digg button code right after the above code. For example, if you want the compact Digg button, add this code below the labels code:-


<div style='float:right; margin-left:10px;'>
<script type='text/javascript'>
digg_url=&quot;<data:post.url/>&quot;;
digg_skin=&quot;compact&quot;;
</script>
<script src='http://digg.com/tools/diggthis.js' type='text/javascript'/>
</div>


The resulting layout is this:-

Add Digg button to Blogger or Blogspot

Move the Digg button code above the labels if you'd like. Experiment a little. Just remember to preview the template and not to save it unless you are satisfied.

Digg Button in Blog Footer

If you do not want to see an Automatic Count button, you can also place a link button into the template. This button will appear at the bottom right corner of every post and readers can click it to submit that post to Digg.

Scroll to this part of the template and insert the lines (in red):-

<div class='post-body'>
<p><data:post.body/></p>
<div style='clear: both;'/> <!-- clear for photos floats -->
</div>

<div style="float:right; margin-left:10px;">
<a expr:href='"http://digg.com/submit?phase=2&amp;url=" +
data:post.url + "&amp;title=" + data:post.title'
target='_blank'><img border="0" alt="Digg this" src="http://digg.com/img/badges/91x17-digg-button.gif"/></a></div>



With the code, this is what you will see at the end of every post.

Add Digg button to Blogger or Blogspot

You can change the position of this button. Go through what we discussed earlier in this article to understand where to place the code if you should want the button to be at the top of the article.

The button 91x17-digg-button.gif is simply an example. As the following section explains, there are many buttons you can use. To change the button to another design, replace the image URL with that of the new button.

CIA rebuffs Cheney on interrogation records

Citing pending legal action, the CIA has rejected former vice president Dick Cheney's call to release documents that he claims would show that harsh interrogations helped stop terrorism, The Weekly Standard reported earlier, according to our colleagues over at The Oval.

The Washington Post has also filed.

"A document is excluded from mandatory declassification review if that document contains information that is the subject of litigation," the CIA said in a letter released today.

"For that reason — and that reason only — CIA did not accept Mr. Cheney's request for a mandatory declassification review," agency spokesman Paul Gimigliano said. He added that said Cheney's request was handled "in accordance with normal practice, by CIA professionals with long experience in information management and release.

Human-caused wildfires increase in Calif.


LOS ANGELES — Embers drifting from a campfire in a seaside canyon ignite a wildfire that incinerates 53 homes in Malibu.

A man driving on a national forest road stops on tinder-dry grass. The hot engine acts like a match, kindling a wildfire that burns thousands of acres.

And authorities suspect that a blaze that destroyed 78 homes in the Santa Barbara area last week was started by sparks from a power tool being used to clear brush.

A growing number of wildfires in California are joined by a common, incriminating back-story: People caused them.

Government statistics show that people were faulted for 5,208 wildfires in Southern California in 2008, the highest number since at least 2001. Between 2006 and 2008, Southern California was the only region of the country to see a significant jump in the number of wildfires blamed on people, an unsettling statistic given the damage that can follow.

There is no single cause for the increase, experts say, with issues ranging from better investigations and reporting to the warming effects of climate change. But most agree: In a densely populated, drought-stricken region where development pushes into areas known to burn, the result is predictable.

"As the drought continues in California, there are going to be more human-caused fires," says Don Smurthwaite, a spokesman for the National Interagency Fire Center in Idaho.

"You can see the spread of development in virtually every area of the West," he says. "More people is always going to equate to more fires."

Southern California's fire season was once thought to be limited to the fall, when Santa Ana winds roar through mountain passes into heavily populated coastal areas. But it's now seen as a year-round danger, a conclusion witnessed in Santa Barbara last week. Warmer, drier weather in a region of more than 20 million people with a history of wildfires is proving a combustible mix, fire center figures suggest.

And some of those blazes are leading to the courtroom, where prosecutors are bringing charges from arson to negligence.

Gov. Arnold Schwarzenegger declared a statewide drought in June and in February declared a state of emergency because of three years of below-average rain and snowfall in California.

In Los Angeles, rainfall for the year that began July 1 is nearly 6 inches below average in a city that typically sees scant precipitation. In the state's agricultural Central Valley, three years of drought have forced farmers to let thousands of acres of cropland turn to dust.

Nationally, about 70,000 wildfires in 2008 were attributed to human causes — a thoughtlessly flicked cigarette, a campfire left smoldering, a fallen power line. That's about the same number as 2001, although the figures fluctuate from year to year. Since 2001, the peak was 80,220 wildfires caused by humans in 2006, according to fire center records.

In Southern California, the number of wildfires caused by people was about flat — roughly 4,000 — between 2001 and 2005. It dipped to 3,200 in 2006. Then, those figures increased sharply, to 5,140 in 2007 and 5,208 in 2008, according to the data.

The increase in Southern California stands out. In Alaska, for example, the number of wildfires blamed on people has been gradually slipping since 2004. Nationally, the number of wildfires attributed to human causes dropped in 2007 and 2008.

Lightning strikes account for just a fraction of all wildfires — about 8,800 across the nation in 2008. In Southern California, the number of wildfires blamed on lightning dropped from 409 in 2006 to 291 in 2007 and 174 last year.

Firefighters this week were extinguishing the last of a now-smoldering wildfire in the Santa Barbara area, which at its peak forced thousands of people to flee their homes. It blackened about 13 square miles. Authorities are trying to identify the person using a power tool that they believe caused the blaze.

Given the large number of wildfires in the state, only a small number lead to criminal or civil cases. The U.S. Forest Service alone recorded nearly 400 arson wildfires since 2005, records show. Prosecutors have wide discretion, and recent wildfires in Southern California have produced a patchwork of results in the courtroom.

A pipe grinder who accidentally started a 240,000-acre wildfire in Santa Barbara County in 2007 that injured 40 people initially faced felony counts, but those charges were dismissed. He did not have to pay restitution to injured firefighters, pleaded no contest to a misdemeanor of negligently setting a fire and was fined $200.

Earlier this week, a man was sentenced to 16 years in prison after pleading no contest to arson for setting a series of fires in Los Angeles' sprawling Griffith Park last year.

Ten people who built a campfire were not charged with igniting a wildfire last fall that burned more than 200 homes in Santa Barbara and neighboring Montecito because investigators could not prove who caused the wildfire.

They were charged with misdemeanor trespassing and unlawfully building a campfire. The wildfire seriously injured two people and destroyed rows of multimillion-dollar homes, including actor Christopher Lloyd's $11 million home in Montecito.

"Two things are important for prosecutors to look at: one is the intent ... but on the other hand, there is the harm," says Riverside County Deputy District Attorney Michael Hestrin.

"It's a judgment call," he says. "No two cases are the same."

Copyright 2009 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.

Some states pass sovereignty measures


WASHINGTON — For some states, the message to the federal government is clear: Back off.

Legislatures in Alaska, Idaho, North Dakota, Oklahoma and South Dakota this year have approved resolutions asserting sovereignty under the 10th Amendment of the Constitution and suggesting that Uncle Sam "cease and desist" from interfering in their business.

The largely Republican backers say the federal government has overstepped its constitutional bounds by meddling in local matters ranging from education to drunken driving. "It's telling the federal government, 'Guys, you really need to back off,' " said Judy Burges, a GOP state representative who is sponsoring a sovereignty resolution in Arizona.

Oklahoma's Senate on Wednesday gave final approval to a sovereignty resolution, in defiance of a veto from the state's Democratic governor, Brad Henry, on a similar measure. The resolution already passed the Oklahoma House twice.

Similar measures are under consideration in at least two dozen other states. State sovereignty efforts have won the endorsement of two GOP gubernatorial candidates, one of whom — Gov. Rick Perry, up for re-election next year in Texas— made headlines last month by suggesting the movement could lead to some states seceding.

The last time that happened, when South Carolina declared its independence in 1860 followed by 12 other Southern states, it led to the Civil War that marked the presidency of Abraham Lincoln.

Some authors of sovereignty resolutions insist it is slander to paint them as secessionists.

"That's ludicrous. That's not what we're trying to do," said Rep. Manny Steele, the Republican whip of South Dakota's House.

Jeff Breedlove, chief strategist for Georgia Republican gubernatorial hopeful John Oxendine, said his boss is not supporting secession with his statement in support of state sovereignty efforts.

"We love our country," Breedlove said. "The whole point of this is to honor the founding fathers by honoring the 10th Amendment of the Constitution."

Others aren't so definite. "Why would I want to rule anything out?" said state Rep. Charles Key, R-Okla. "Why would we take a position that says 'We really don't like this but we're only going to go so far?' "

Henry said he vetoed the resolution because he was concerned about losing federal funds — and found it unnecessary. "There is no need to spend valuable legislative time on a resolution expressing support for any particular amendment or constitutional right," he wrote in his veto message.

The effort seems to have its biggest impetus in states that President Obama lost in last year's election. All five states where the resolution made it through both chambers of the legislature backed the Democrat's rival, Republican Sen. John McCain of Arizona. Of six other states where state sovereignty has passed one legislative chamber, only Indiana voted for Obama.

Supporters insist this isn't a red state rebellion and that they are trying to take a stand against federal encroachment on state authority that has been going on for decades.

"It has nothing to do with the Obama administration," said Key. He first introduced a state sovereignty resolution last year, when Republican George W. Bush was still in the White House.

Like a number of other state lawmakers, Key said it was a law backed by the Bush administration establishing expensive security measures when issuing drivers' licenses — known as the Real ID Act — that prompted his action.

Rep. James Sensenbrenner, R-Wis., author of the federal law, said members of Congress "recognized the issue of federalism and state sovereignty in drafting Real ID. No state is required to adopt Real ID."

Michael Boldin, a Los Angeles-based web marketer said he started the Tenth Amendment Center website "as a response to George Bush and Dick Cheney." Boldin, 36, said he opposes the wars in Iraq and Afghanistan and backed Republican Ron Paul for president.

Even so, there's no question that some Obama administration moves are fueling some of these resolutions. Arizona's Burges doesn't like requirements that union labor be used for projects funded by federal stimulus funds.

"We're a right-to-work state," she said, using shorthand for laws designed to limit the influence of labor unions at the workplace.

The resolutions that have passed have no legal effect, but Key and Steele said they hope to organize a summit where state lawmakers could plan their next move.

One possibility: organizing civil disobedience where states agree to defy a federal rule. That could trigger a legal case going all the way to the Supreme Court, now dominated by GOP appointees.

"It's not off the wall," said Georgetown University law professor Paul Rothstein, "It's quite possible that this court could go for something like that."

Contributing: Mimi Hall

SHARE THIS STORY:

Astronauts install new camera on Hubble


CAPE CANAVERAL, Florida — Using elbow grease to avert disaster, a spacewalking astronaut battled a stubborn bolt to pull an outdated camera out of the Hubble Space Telescope on Thursday. His success paved the way for the installation of a more powerful camera that will allow the telescope able to peer even further into the past.

Astronaut Andrew "Drew" Feustel unexpectedly ran into trouble on Thursday as he attempted to turn a bolt holding the 15-year-old Wide Field Planetary Camera 2 onto the observatory. Feustel tried various tools to pry out the bolt, but it would not budge. If the bolt had broken off as he wrenched it, the old camera would've stayed in the telescope and its $132 million replacement would've had to return to Earth.

In the end, the combination of a different tool and sheer muscle saved the day.

"I think I got it!" exclaimed Feutsel, who was making his first spacewalk, as he pried the bolt out.

Feustel had less success later in the spacewalk, when he tried to install some mechanisms that would make it easier to open up the telescope for repairs.

"That'll do it, we hope," as he tried once again to turn a sticky bolt. "Been doing a lot of that."

Feustel and six crewmates are making the fifth and final house call to the renowned Hubble. The astronauts, who pulled up to the telescope Wednesday aboard space shuttle Atlantis, are scheduled for a whirlwind six-day stay to upgrade and repair the telescope for the last time.

Thursday's outing was the first of five spacewalks in five consecutive days. It was supposed to be a straightforward jaunt, so much so that before Atlantis launched, Hubble program manager Preston Burch pegged the odds of success at close to 100%.

The aging Wide Field 2 had other plans. When it came time to slide the old camera out of its slot on the telescope, Feustel tried first one tool, then another and another to turn the bolt that latched the camera to Hubble. Veteran spacewalker John Grunsfeld, Feustel's partner, even double-checked that Feustel had positioned his tools correctly.

The stakes were high. Though Wide Field 2 has been a workhorse for the Hubble, astronomers are anxious to start using its successor, Wide Field Camera 3, which promises to be 15 to 40 times more powerful. For instance, Wide Field 3 promises to give astronomers a view of galaxies forming just after the Big Bang.

There will be no more opportunities for Wide Field 3 to return to the Hubble. The only spacecraft capable of visiting the telescope is the shuttle, and it will be retired next year without making any more Hubble flights.

Luckily, Feustel found the right tool for the job and exerted enough force to get the bolt out.

"It's been in there for 16 years, Drew, and it didn't want to come out," said Grunsfeld.

"It just decided to be a recalcitrant teenager," said astronaut Michael Massimino, who was supervising the spacewalk from inside Atlantis and has a 13-year-old daughter and a 15-year-old son.

Later in the spacewalk, balky hardware did defeat Feustel as he tried to install some latches on the access doors to Hubble's interior. He got two in place but did not manage the third.

"It was a day of surprises," Feustel said as he prepared to re-enter Atlantis. "In traditional Hubble fashoin, Hubble threw us a few curves," said Grunsfeld, who was making his sixth spacewalk to service the telescope. "We were able to overcome them." He noted that they installed both the new camera and a replacement electronics box that routes data to and from the ground. The original box broke down in September.

The problems dragged the spacewalk out to nearly seven-and-a-half hours, an hour longer than planned and an hour longer than NASA likes to keep its spacewalkers "outside" in the vacuum of space.

"Ready for a hot shower and a good meal," said Grunsfeld as he prepared to re-enter Atlantis's hatch. "We'll see what we can do," Massamino promised his crewmate.

Copyright 2009 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.