|
|
> | Internet > Web > Web Design > Markup Languages > XML > |
Using XSL Templates |
||
|
Preview DRM-free music
Get information on your favorite TV Shows at
Clarify the meaning of the acronyms on your web site. Register your own domain name at A to Z Domains. or buy domains at Domain Names For Sale .net
Printer-friendly PDF* format: |
"How To" Guides for XMLHow to repurpose mobile content for traditional web browsersWhen content needs to be delivered to both traditional web browsers and smaller mobile devices, one technique for producing content for both channels from the same source is to code the content for one channel and repurpose it for the other channel. In most cases, the content for traditional web browsers already exists, so the tendency is to try to repurpose that content for smaller devices. However, it's much easier to design the content for the smaller portable devices and use XSL templates to repurpose the content for larger displays by wrapping it with additional markup code. This technique is particularly useful for sites using a ".mobi" domain name managed by the dotMobi registry, since the registry requires sites to be designed for mobile devices. For an example see the Sample .mobi site Sample XHTML fileThe XHTML file contains the page-specific content that is delivered to all types of browsers. No site-wide common elements are included, since those are put into separate templates. Sample XHTML file
<?xml version="1.0" encoding="UTF-8"?>
See .mobi sites in Internet Explorer for issues displaying ".mobi" web sites in an IE browser. Sample XSL templatesCommon elements that need to appear on every page throughout the site would be put into templates in an XSL file referenced by the XHTML pages. sample.xsl
<?xml version="1.0" encoding="UTF-8"?>
More sophisticated sites could have various groups of pages which are similar to each other, but are different from the pages in other groups. In this case, more than one level of templates would be used. For each group of similar pages, a separate template would be created for the common elements on the pages within that group. Those templates would all import a single site-wide template containing the common elements that would appear on all pages across the entire site. Style sheet for traditional web browsersscreen.css
img {
Style sheet for handheld deviceshandheld.css
img {
.htaccess fileTo deliver the XHTML and WML pages with the correct MIME types, you will need an .htaccess file will the following directives, or their equivalent for the web server software you are using: .htaccess
DirectoryIndex index.xml
Contrary to the HTTP standards, Internet Explorer pays more attention to the file extension than to the
MIME
types specified by the server.
Therefore, the default Last updated Sunday March 25, 2007 |
You are currently viewing this page in XHTML 1* format (* see Clicklets for more infomation). This document is also available in XHTML 1 Style Sheet*XML* HTML 4*HTML 5 Style Sheet*HTML 5 XML*HTML 5 non-XML* XHTML 2* XHTML Mobile* WML Mobile* and printer-friendly PDF* formats. This is accomplished with Single Source Publishing, a content management system that uses templates in XSLT style sheets provided by XML Styles .com to transform the source content for various content delivery channels. There is also RDF* metadata that describes the content of this document.
Copyright © 2007 How To Guides .com. Alteration of content, including addition of any function such as hypertext links or pop-up advertising, or interference with the hypertext links or other functions of this site is expressly prohibited.
DISCLAIMER: All information, links, forms, applications and other items on this site or obtained from it are provided AS IS, WITHOUT WARRANTY OF ANY KIND EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.