Archive for January, 2008

Extensible Markup Language ( XML ) is a standard way to store and share information , describing data and to focus on what data is.

Xpath is a language that makes possible find information in an XML document. This language has a huge importance in the W3C’s XSLT standard and is the base of Xquery and Xpointer. With Xpath we can navigate through elements and it’s attributes. The wide use of XML and the importance of Xpath turns it in a fundamental knowledge in the ITs world.

In this post I’ll answer a friend that has an advanced question. However, I will try to give some basic explanations for those who don’t want to study XML and Xpath from the beginning.

If you want to learn Xpath I recommend the Xpath tutorial from wschools.

Let’s start showing the data that I will use to answer. The information shown bellow is only for the example.

<?xml version=”1.0″ encoding=”UTF-8″?>
<store>
<product>
<identification>
<full_name>Laptop</full_name>
<model>XGSB-2</model>
</identification>
<price>1000</price>
<available value=”yes” />
</product>

<product>
<identification>
<full_name>Desktop</full_name>
<model>DRHD-2</model>
</identification>
<price>500</price>
<available value=”yes” />
</product>

<product>
<identification>
<full_name>Desktop</full_name>
<model>DRHD-3</model>
</identification>
<price>600</price>
<available value=”no” />
</product>
</store>

The information shown below is a XML content that has some elements structured like a tree of nodes. In XML there are many nodes, like elements, attributes, text, and others.

Now is time to think in my friend’s question. He wants to get all identification information from the products that are available.

After see the XML content let’s check how to navigate through it and get the information that we want. Xpath has some expressions to select nodes lile:

Expression Description
Nodename Selects all child nodes of the named node
/ Selects from the root node
// Selects nodes from the current node that match the selection no matter where they are
. Selects the current node
.. Selects the parent of the current node
@ Selects attributes

With the expressions above we can build the path to the identification information that we want.

/store/product/identification

This expression can be built in other ways and returns all product identification nodes.

Now we use one predicate to select only the products that are available, this information is in an attribute of the available element. The basic use of predicates is apply a condition to an element or an element that is a sibling like the current one, e.g. an element is the same level of the current. The doubt is that we want the attribute of an element that isn’t in the direct navigation path and we will to use the elements name and check it’s attribute with another predicate.

We can put a predicate insider another one? Yes. We will use it on this example.

The predicate applies to an element or a parent element or a sibling element. Its position in the query affects the expression in the predicate. In this case, we must be aware that the element in the predicates expression shouldn’t be a full path because using one, we check if there is some available element, inclusive from another product, with its value attribute set to true.

Then, using tow predicates we have the following query: /store/product[available[@value=”true”]]/identification

Xpath have functions that can be use to solve some problems. In this one, the use of a predicate inside another solves it without have to use functions.

To check this example working I used PHP and its DOM extension to work with XML. A very easy way of navigate and find information in a XML document. Check the source code below:

<?
echo “Starting checking available products <br />”;

$xml = new DOMDocument();
$xml->load(‘products.xml’);

$xpath = new DOMXPath($xml);
$products = $xpath->query(‘/store/product[available[@value=”yes”]]/identification’);

for ($i = 0; $i < $products->length; $i++)
{
if ($products->item($i) && !$products->item($i)->hasChildNodes()) continue;

$childs = $products->item($i)->childNodes;

echo “<br />Full name: “.$childs->item(1)->nodeValue.”<br />”;
echo “Model: “.$childs->item(3)->nodeValue.”<br />”;
}
?>

Amazing Honda campaign

January 11th, 2008 No Comments

While surfing the web, especially in YouTube, I found a great commercial spot from Honda. This spot has something like 2 years, but I think it’s amazing and I want to share it with you.

This spot is not an interactive web campaign neither some marketing innovation technique but a simple and really good TV spot.

Honda is a great car manufacturer but they are showing that cars aren’t the only thing that they do good. Besides the old spot above, there is a really cool one recently published to promote Honda Civic.

I love Japanese cars and Honda ones are really great. Their quality and the fantastic campaigns that they made help Honda to still one of the most known brands.

Honda – The power of dreams

With the evolution of the Internet and virtual world the marketing has become in new and interactive solutions that capture the watcher attention and incentive him to participate.

Web Marketing is a new age where brands can be more close to the client and surround him in the world of its campaigns. The interactivity offered by Rich Interactive Applications (RIA), available in the new information age, turns the client from a watcher to a player or a character that participates in the campaign.

The possibility to interact in the campaign allows the watcher to easily recommend the campaign to his friends, making the term “viral marketing” a reality with a publicity made by your own clients and/or visitors.

In the last year there were several campaigns that reflect this new age of marketing. Here I’ll show and describe different types of campaigns made in 2007.

Na tua casa ou na minha? – Montepio Geral (Portugal)

Na tua casa ou na minha? - Montepio

A Portuguese bank called “Montepio Geral” launched a campaign to show how simple its mortgages solutions are. They intended to build a TV and web campaign.

The first step was to choose a good slogan and the one was “Na tua casa ou na minha?” (“In your place or in mine?”), trying to let the watchers mind fly to sexual intention, at least in the Portuguese expression. With the slogan and a piece of the campaign, a provocative piece, they launched a web campaign exploring the viral marketing by showing online the campaign even before the TV to all visitors that have seen and recommend the web site. The video of the campaign was published in the YouTube being available to the public and making part of the web campaign.

The web site of the campaign is no longer online but the URL http://www.natuacasaounaminha.com takes the visitor to the mortgages page of the bank.

Gamebox – Sporting (Portugal)

In this campaign we enter in a more interactive world, where the Gamebox web campaign from the world wide known soccer team Sporting, allows the web site visitor to be part of the campaign.

Gamebox - Sporting

The “Gamebox” campaign asks your name and phone number and starts the campaign movie. The movie shows all players, some of them international and shows the coach waiting for someone. After a while the coach makes a phone call. For your surprise the visitors phone (the same you gave to the campaign) starts ringing. When you answer, the coach, Paulo Bento, start talking with you saying that they’re waiting for you and your presence is important. If you don’t answer the phone, the behavior of the coach is different.

This type of interactive campaign is a way to mark the visitor and call his attention to the product, even if he don’t buy, he will not forget it so soon.

The interactive version of the campaign is no longer available but the standard trailer still at: http://www.sporting.pt/Servicos/Gamebox/Gameboxvideo.asp

“Fight for kisses” – Wilkinson (International)

The last example is a fully interactive campaign with a game, a trailer and some goodies to enter visitors mind and shows the product advantages. A campaign based on a full history, have a meaning and a purpose. This campaign started in 2007 but still going this year.

This campaign is a fully Rich Interactive Application (RIA) that shows the baby’s fighter world. It has a story, a really good movie animation campaign, some goodies and a great game that allows the visitor to fight for a cause and take the campaign spirit.

Fight for kisses - Wilkinson

Check more about this campaign on another post of this blog.

Campaign “Figh For Kisses”Recently I visited an amazing web campaign with a Rich Interactive Application (RIA), a really cool trailer, some other great features to explore, like screensavers, desktop backgrounds and other stuff, and the most important, a game to really fight for the cause that will be released soon. A fully interactive web site that takes the visitor to a world of animation that gets his attention.

This campaign from Wilkinson explores the idea of a fight between fathers and sons to get the wife/mother attention. The son get all attention until the father saw the new Wilkinson Quattro Titanium that shaves so well that the man’s face feels like a baby skin. For now on, the baby has a player at his level. So, the baby will practice and fight for the moms attention. A really cool campaign, more than a simple trailer, that takes the visitor to a new experience. You must see this campaign, really great, genius.

I’m waiting to see the game. A battle between a well prepared baby wanting the moms attention back and a man…well shaved! If the game will be so great like the history and the RIA it will be an amazing campaign.

Greetings to Wilkinson and its partners for the great job.

Campaign is online at http://www.ffk-wilkinson.com/, check it out.

Game will be release on 04/01/08

Brand Wilkinson

Recent comments

Valid XHTML 1.0 Transitional Valid CSS!

Recent posts

2007-2014 © ProTech, All rights reserved | Powered by WS4.org