Posts Tagged ‘html’

Always Consider Your Audience When Designing Web Pages

by Alan Spencer

With so many companies these days relying on the internet as an electronic storefront for selling their wares, web page design has become a fast-growing occupation. However, there is still a lot of argument as to the best approach to designing a web page; with those having a background in graphic arts opting for a website that has visually appeal and those with a more technical background preferring web page design to incorporate elements that are appealing to internet search engines. These two approaches will often be at odds regarding the site’s structure, but the common goal is surely to drive more traffic to the website in question.

These two different angles, if combined, can very often deliver the best of both worlds and not only help visitors to the site find the information they are looking for, but also make it easy for users to find the site. Design-oriented web developers may be forced to rely on advertising, such as Google Adwords, to bring visitors to their site. Developers who are more technically aware may not create sites with a strong visual appeal. However, they may end up attracting more search engine traffic.

Regardless of the approach, the important aspects of a website will always be the same: content, usability and design are the three most important elements to web page design and pages that are strong in all these three areas have a better chance of attracting an audience and being successful.

While some attractive websites may have an initial aesthetic appeal, if they are laden down with graphics, audio, Flash or video files, they may be slow to load. This can frustrate potential visitors and can lead to less traffic than would otherwise be the case. Each page in a website should take just a few seconds to download.

Content is also immensely important. Both search engines and humans are attracted to good content. If your site has original content which is not available elsewhere on the web, it stands to reason it will get visitors. If users visit a site and it does not contain the information they want, they will simply leave in search of better information.

When planning and designing your website, a useful exercise is to try to place yourself in your visitors’ shoes. What are they looking for? How much of it can you offer them? How can you make your version of it more attractive than what’s on offer from your competitors?

About the Author:

Looping With The For-each Element In XSLT

by Alan Spencer

Extensible Stylesheet Language (XSL) is a technology closely related to XML which is used to transform XML data. XML file are used to set out the ground-rules for a given body of data and to describe the data itself. XSL allows us to take the original XML data and convert it into information which can be displayed in a web browser window or opened with a text editor. XSL can also be used to create an XML file which is a modified version of an original XML file.

When displaying elements in a browser window, the XSL elements which enable looping through an XML tree and decision-making really come into their own. One of the key methods used in XSL for looping through XML elements is the “For-each” element. This uses the “select” attribute to specify which element is to be targeted in the loop. The “For-each” element has both an opening and a closing tag and any lines of code placed between the opening and closing tags will be repeated each time the element specified in the “select” attribute is encountered in the XML file.

For example, let’s say we have an input XML file containing a list of companies and the addresses of their websites. Let’s also say that the element which we will be targeting in the XSL “For-each” statement is called “company” and that, for each company element, we have a “name”, “telephone” and “website” element. Before beginning our “For-each” loop, we could output the opening tag of an HTML “ul” element (an unordered or bulleted list).

Inside the “For-each” loop, we could then output an HTML “li” element and, between the opening and closing “li” tags, output the contents of the “name” and “telephone” elements from the XML file. The data in the “website” could then be used to convert the “name” into a clickable link.

As for the appearance of the data in the resulting HTML output, this would be controlled by a linked CSS file. CSS can be used to format the output in any way we like, so our bulleted list can take on pretty much any appearance we desire.

About the Author: