Browsing
Nokia XHTML FREQUENTLY ASKED QUESTIONS version 1.3
(updated 13-Jan-05)
What is XHTML?
What is the idea behind XHTML?
What is the difference between HTML and XHTML?
What is XHTML Basic?
What is the main difference between XHTML 1.1 and XHTML Basic?
What is XHTML Mobile Profile?
What are Cascading Style Sheets (CSS)?
Why should CSS be used?
What is WAP CSS (WCSS)?
How is WAP related to XHTML?
Will XHTML replace WAP?
Are Nokia terminals dual-mode, in other words will they support both current WML and XHTML?
Why does Nokia not implement WML 2.0 WAP extensions?
How to use Cascading Style Sheets with XHTML?
What tools are available for creating XHTML content for Nokia devices?
What is CHTML?
What is the difference between CHTML and XHTML Mobile Profile?
Are some XHTML elements mandatory?
What is the Document Type Definition (DTD) for an XHTML Mobile Profile document?
What is the MIME Type for XHTML Mobile Profile documents?
How are WML and XHTML documents linked?
How is WTAI used?
How is the tel: URI scheme used?
How are WML events used in an XHTML page?
How is a style sheet created?
How are style sheets applied?
How do style sheets work?
Can Accesskeys be used in XHTML Mobile Profile?
Can WML variables be used in XHTML Mobile Profile?
Can WML scripts be used in XHTML Mobile Profile?
What happens to selection lists if they do not fit in the available screen width?
What should be avoided when using nested tables?
What character sets are supported by all Nokia devices?
Will the gateway handle the character conversion?
What is content upload?
Which Nokia devices support content upload?
What should be kept in mind when creating WMLScript for TCP/IP stack devices?
- What is XHTML?
-
XHTML (Extensible HyperText Markup Language), according to the W3C (World Wide Web Consortium), is the first major change to HTML since HTML 4.0 was released in 1997. In fact, the latest version of HTML (v. 4.1) forms the basis for XHTML: all tag definitions and syntax are the same. XHTML simply adds modularity and enforces strict adherence to language rules. As a result, XHTML brings a clean structure to web pages, which is especially important given the small screens and limited power of mobile devices. W3C recommends that XHTML is used for all future web development for desktops as well as all other devices, including mobile devices.
- What is the idea behind XHTML?
-
XHTML is the keystone in W3C´s effort to create standards that provide richer web sites on an ever-increasing range of browser platforms. Browsers are not limited to desktops, instead there are platforms including mobile devices, televisions, cars and wireless personal digital assistants (PDA). Using XHTML, content providers will find it easier to produce content for a wide range of platforms, with better assurances as to how the content is rendered. Additionally, Cascading Style Sheets (CSS) can be used to control how the content is presented on the screen.
- What is the difference between HTML and XHTML?
-
XHTML uses well-formed XML syntax, meaning that there are some XML rules that are required in it (which is not the case in HTML). These are:
- XHTML elements must be properly nested.
- Element and attribute names must be in lowercase.
- All XHTML elements must be closed.
- Attribute values must always be enclosed in double or single quotes.
- All empty tags must be self-closing (for example <br />).
- Attribute value pairs cannot be minimized.
- What is XHTML Basic?
-
XHTML Basic is the mobile version of XHTML 1.1. XHTML Basic is designed for Web clients that do not support the full set of XHTML features; for example, Web clients such as mobile devices, PDAs, pagers and set-top boxes. With XHTML Basic, a document can be presented on the maximum number of web clients, including a wide range of mobile devices featuring different display formats and presentation capabilities.
- What is the main difference between XHTML 1.1 and XHTML Basic?
-
XHTML Basic is the mobile adaptation of XHTML 1.1, and includes everything in XHTML 1.1 except those capabilities, such as frames, that are not appropriate for devices with small screens.
- What is XHTML Mobile Profile?
-
XHTML Mobile Profile is defined by WAP Forum, starting with XHTML Basic and adding few elements and attributes from full XHTML 1.1 that are useful in mobile browsers including additional presentation elements and support for internal style sheets. XHTML Mobile Profile is a strict subset of XHTML.
- What are Cascading Style Sheets (CSS)?
-
Cascading Style Sheets describe how documents are presented on screen in the browser. The CSS separates the presentation from the content. Changes to the presentation can be made in the style sheet and the changes are automatically reflected throughout the whole document.
- Why should CSS be used?
-
CSS is critical for the mobile browser by making it easy to display the same document on a wide variety of devices, each with its own display formats and capabilities. The power of CSS lies in the precise control it offers to document creators and the ease with which they can create content for presentation on any device. Every aspect of the document (positioning, fonts, text attributes, borders etc) can be defined in the style sheet. A change to any aspect of the document only needs to be done once.
- What is WAP CSS (WCSS)?
-
WAP CSS is the mobile version of CSS, as defined by the WAP Forum. It is a subset of CSS, omitting features that are not appropriate for very small devices.
- How is WAP related to XHTML?
-
XHTML Mobile Profile is the markup language of WAP 2.0.
- Will XHTML replace WAP?
-
The XHTML Mobile Profile markup language along with Cascading Style Sheets is most of what makes up WAP 2.0. It offers some advantages over the original WML, particularly in the area of content presentation, but it also borrows a great deal of what works well in WAP. For instance, scripting and push borrow heavily from earlier WAP specifications.
- Are Nokia terminals dual-mode, in other words will they support both current WML and XHTML?
-
All Nokia devices that support XHTML will also have native support for WML 1.x. XHTML Mobile Profile and WML 1.x pages may link directly to each other using URLs in anchors, form actions, and in WML other events. The history is maintained so the user can go back, no matter what kinds of content are intermixed.
- Why does Nokia not implement WML 2.0 WAP extensions?
-
According to the specification, WAP 2.0 compliant browsers must support XHTML Mobile Profile and WAP CSS and either natively support WML 1.x or have support for WML 2.0 WAP extensions. All Nokia devices that support XHTML will also have native support for WML 1.x. Therefore WML 2.0 WAP extensions are unnecessary.
- How are Cascading Style Sheets used with XHTML?
-
External style sheets can be used by adding a style sheet link to the XHTML code. When the XHTML content page has a link to a style sheet, the server returns the appropriate style sheet, which is then cached in the browser, so all subsequent pages are rendered immediately.
- What tools are available for making XHTML content for Nokia devices?
-
Both XHTML-MP/WCSS and WML/WMLScript can be developed and tested with the Nokia Mobile Internet Toolkit (NMIT). NMIT provides simulators for a number of devices, allowing content developers the opportunity to test and optimize content without needing to maintain a large collection of test devices. Nokia Mobile Internet Toolkit and additional device simulators can be downloaded from the Forum Nokia web site.
- What is CHTML?
-
CHTML (compact HTML) is the markup language that is used for iMode services. It does not support Cascading Style Sheets and it does not need to be well-formed, which means that it can produce inconsistent results from browser to browser.
- What is the difference between CHTML and XHTML Mobile Profile?
-
XHTML Mobile Profile is similar to CHTML (compact HTML) with a few exceptions. XHTML is a W3C standard widely accepted throughout the industry (CHTML is a proprietary standard developed for iMode). Unlike CHTML, XHTML Mobile Profile supports Cascading Style Sheets. Technically, CHTML does not need to be well formed, which means that it can produce inconsistent results from browser to browser, and it lacks the header and DTD, which gives XHTML much of its power.
- Are some XHTML elements mandatory?
-
Yes. All XHTML documents must have a DOCTYPE declaration. The <html>, <head> and <body> elements must be present, and the <title> must be present inside the <head> element.
- What is the Document Type Definition (DTD) for an XHTML Mobile Profile document?
-
The DOCTYPE header specifies the XHTML Mobile Profile Formal Public Identifier and may also include the URI of the XHTML Mobile Profile DTD:
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN"
"http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
- What is the MIME Type for XHTML Mobile Profile documents?
-
XHTML Mobile Profile documents do not have a single MIME media type. However, the most preferred MIME type is application/vnd.wap.xhtml+xml which should be used for serving XHTML documents to XHTML user agents. In addition application/xhtml+xml can also be used. Another available MIME type is text/html but using it for XHTML should be limited to rendering on existing HTML user agents. XHTML documents served as text/html will not be processed as XML. As a result, structural errors may not be detected by user agents. Authors who wish to support both XHTML and HTML user agents may utilize content negotiation by serving HTML documents as text/html and XHTML documents as application/vnd.wap.xhtml+xml.
- How are WML and XHTML documents linked?
-
This example shows how to create a link from an XHTML page to a WML deck and vice versa.
--------------page1.xhtml---------------
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN"
"http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>XHTML Mobile Profile page</title>
</head>
<body>
<h1>A link to a WML deck</h1>
<p>
<a href="deck1.wml#go">Link</a>
</p>
</body>
</html>
--------------deck1.wml------------------
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN" "http://www.wapforum.org/DTD/wml13.dtd">
<wml>
<card id="go" title="WML deck1">
<p>
This is a WML deck. </p>
<p>
<anchor>Here <go href="page1.xhtml"/></anchor> </p>
<p>you can go back to the page.xhtml.</p>
</card>
</wml>
- How is WTAI used?
-
Those WTAI public library functions supported by the browser can be used directly in an XHTML page. For example, the MakeCall function, which is used for making a phone call directly from an XHTML page, is defined with the following string:
<a href="wtai://wp/mc;+123456789">Call 123456 789</a> - How is the tel: URI scheme used?
-
The tel: URI scheme allows the user to make a phone call by clicking on a link within the browser. The content developer can take advantage of this feature by placing a URI, such as href="tel:5551212", within the <a> element. The user is returned to the browsing session after the call is terminated.
<a href="tel:+123456789">Call 123456 789</a>
- How are WML events used in an XHTML page?
-
The concept of events was unique to WML, but (e.g. pete) the "ontimer" event could be replaced with HTTP refresh. WML events can also be used by creating a link from an XHTML page to the WML card containing the event.
- How is a style sheet created?
-
This is an example style sheet that can be used with Nokia XHTML browsers. Notice that it does not include all specified WCSS properties.
/*
* A sample style sheet for XHTML Mobile Profile
*/
body {font-weight:normal; font-size:medium; font-family: sans-serif}
p {margin-top:2px; margin-bottom:2px}
strong {font-weight:bold}
caption {text-align:center; font-weight:bold}
blink {text-decoration:blink}
li {color:black}
ol {list-style-type:decimal; margin-left:12px; margin-top:2px; margin-bottom:2px}
ul {list-style-type:disc; margin-left:12px; margin-bottom:2px; margin-top:2px}
table,tr {border-width:1px; border-style:solid; text-align:center}
td {align:right; valign:middle; border-width:1px; border-style:solid}
th {font-weight:bold; text-align:right}
hr {text-align:center; height:2px; width:100%; margin-top:2px; margin-bottom:2px}
h1 {font-weight:bold; font-size:11px; margin-top:2px; margin-bottom:2px}
h2 {font-size:11px; margin-top:2px; margin-bottom:2px; font-weight:normal}
h3 {font-weight:bold; font-size:9px; margin-top:2px; margin-bottom:2px}
h4 {font-size:9px; margin-top:2px; margin-bottom:2px; font-weight:normal}
h5 {font-weight:bold; font-size:8px; margin-top:2px; margin-bottom:2px}
h6 {font-size:8px; margin-top:2px; margin-bottom:2px; font-weight:normal}
input {margin:1px; border-style:solid; border-width:1px; padding:2px}
textarea {border-style:solid; border-width:1px}
select {margin:1px; border-style:solid; padding:2px}
.b {font-weight:bold}
.u {text-decoration:underline}
.big {font-size:larger}
.small {font-size:smaller}
- How are style sheets applied?
-
1. Browser default style sheets are applied first
2. External style sheets override default style sheets
3. <style> block in document header appended or prepended to external styles
a. External styles treated as part of <style> block
b. Typically external style sheet linked first, then is overridden by <style> block in document
4. Inline styles within a tag override any styles defined earlier for that tag only
5. Any style with "!important" attribute overrides other definitions of that style, even if they would otherwise override (For example, "!important" can be specified to force a browser style to override an author style) - How do style sheets work?
-
1. Browser fetches the first page of the application
2. Server returns the content page (includes a "link rel" tag to style sheet)
3. The browser fetches the style sheet. A "User Agent" tag is included in the request header
4. Server returns the appropriate style sheet for the browser type and the style sheet is cached in the browser and all subsequent pages are rendered immediately
5. Browser fetches subsequent pages - Can Accesskeys be used in XHTML Mobile Profile?
-
In XHTML Mobile Profile the accesskey attribute is supported by <a>, <input>, and <textarea> elements. Elements with an assigned accesskey are placed in the Options menu of the browser in the same position as WML <do> elements.
- Can WML variables be used in XHTML Mobile Profile?
-
Variables are not part of the XHTML Mobile Profile specification. Data sharing from one page to another can, for example, be done through an application server.
- Can WML scripts be used in XHTML Mobile Profile?
-
Without WML global variables, there is no way to share data between markup and WML script. WML scripts become useless, but scripting can be done on the server side. WML scripts can also be used in the same way as calling WTAI functions in XHTML by creating a link from an XHTML page to WML card calling the script.
- What happens to selection lists if they do not fit in the available screen width?
-
Selection boxes will be automatically truncated if they do not fit in the available screen width. The truncated text can be expanded by pressing and holding the # key. Content authors should be careful not to use descriptions that significantly exceed screen widths to avoid the risk of confusing and truncated text.
- What should be avoided when using nested tables?
-
When using nested tables, content developers should avoid specifying the parent table width as a percentage when the child table widths are given explicit dimensions. Because there are devices with different screen sizes, percentages will not always represent the same number of pixels. Therefore it is recommended that absolute widths (pixels) be used for both parent and nested tables, to ensure that the content will be rendered properly. Care should be taken to ensure that the total table width is the same as the sum of the widths of the individual columns plus borders and cell spacing. In general, as table nesting levels increase, so does the complexity of the page and the required processing time to display the page. In order to ensure the timely display of pages, very deeply nested tables should be avoided. For some models, a hard limit of 7 is imposed on the table nesting depth.
- What character sets are supported by all Nokia devices?
-
The Unicode 1.0 character set is supported in all devices with an XHTML Browser. Local character sets are supported in some models but content developers should only utilize non-Unicode character sets based on the HTTP accept-charset header for a particular request. ASCII, UCS-2 and UTF-8 character encodings are universally supported. ASCII is preferred for Latin language content (where possible) to reduce the bandwidth necessary to receive the response. UCS-2 is preferred over UTF-8 for the Unicode character set since the client does not have to convert it to the Unicode internal representation format. UTF-8 is preferred for all other character sets, allowing the client the greatest flexibility to map specific local characters onto optimal Unicode characters.
- Will the gateway handle the character conversion?
-
Some gateways and proxies convert local character sets to Unicode, but not all. Therefore the only way to guarantee that the terminal receives the content in Unicode format is to create your content in Unicode.
- What is content upload?
-
Content upload technology is used to deliver digital content from a terminal to a server. An example of a content upload service would be a photo album service that allows a user to upload photos taken with the terminal's camera to his or her own photo album on the service provider's server. For more information about content upload implementation in Nokia devices, see document "Series 40 Developer Platform: Designing XHTML Mobile Profile Content".
- Which Nokia devices support content upload?
-
Refer to the document Browser Characteristics In Nokia GSM Devices for up-to-date information.
- What should be kept in mind when creating WMLScript for TCP/IP stack devices?
-
WMLScript is compiled by the gateway as it is sent to devices with a WAP stack. In order to send WMLScript to a browser with a TCP/IP stack, it must be stored in compiled form (wmlscriptc) on the origin server. Further, the origin server must be configured to recognize a new file extension and associate it with the MIME type application/vnd.wap.wmlscriptc. WMLScript content can be compiled and saved using the Nokia Mobile Internet Toolkit.




