J2ME Interview Questions and Answers
What is J2ME ?
Java 2, Micro Edition is a group of specifications and technologies that pertain to Java on small devices.
The J2ME moniker covers a wide range of devices, from pagers and mobile telephones through set-top
boxes and car navigation systems. The J2ME world is divided into configurations and profiles,
specifications that describe a Java environment for a specific class of device.
What is J2ME WTK ?
The J2ME Wireless Toolkit is a set of tools that provides developers with an emulation environment,
documentation and examples for developing Java applications for small devices. The J2ME WTK is
based on the Connected Limited Device Configuration (CLDC) and Mobile Information Device Profile
(MIDP) reference implementations, and can be tightly integrated with Forte for Java
What is 802.11 ?
802.11 is a group of specifications for wireless networks developed by the Institute of Electrical and
Electronics Engineers (IEEE). 802.11 uses the Ethernet protocol and CSMA/CA (carrier sense multiple
access with collision avoidance) for path sharing.
What is API ?
An Application Programming Interface (API) is a set of classes that you can use in your own application.
Sometimes called libraries or modules, APIs enable you to write an application without reinventing
common pieces of code. For example, a networking API is something your application can use to make
network connections, without your ever having to understand the underlying code. 5. What is AMPS
Advanced Mobile Phone Service (AMPS) is a first-generation analog, circuit-switched cellular phone
network. Originally operating in the 800 MHz band, service was later expanded to include transmissions
in the 1900 MHz band, the VHF range in which most wireless carriers operate. Because AMPS uses
analog signals, it cannot transmit digital signals and cannot transport data packets without assistance
from newer technologies such as TDMA and CDMA.
What is CDC ?
The Connected Device Configuration (CDC) is a specification for a J2ME configuration. Conceptually,
CDC deals with devices with more memory and processing power than CLDC; it is for devices with an
always-on network connection and a minimum of 2 MB of memory available for the Java system.
What is CDMA ?
Code-Division Multiple Access (CDMA) is a cellular technology widely used in North America. There are
currently three CDMA standards: CDMA One, CDMA2000 and W-CDMA. CDMA technology uses UHF
800Mhz-1.9Ghz frequencies and bandwidth ranges from 115Kbs to 2Mbps.
What is CDMA One ?
Also know as IS-95, CDMA One is a 2nd generation wireless technology. Supports speeds from
14.4Kbps to 115K bps.
What is CDMA2000 ?
Also known as IS-136, CDMA2000 is a 3rd generation wireless technology. Supports speeds ranging
from 144Kbps to 2Mbps.
What is CDPD ?
Developed by Nortel Networks, Cellular Digital Packet Data (CDPD) is an open standard for supporting
wireless Internet access from cellular devices. CDPD also supports Multicast, which allows content
providers to efficiently broadcast information to many devices at the same time.
What is cHTML ?
Compact HTML (cHTML) is a subset of HTML which is designed for small devices. The major features of
HTML that are excluded from cHTML are: JPEG image, Table, Image map, Multiple character fonts and
styles, Background color and image, Frame and Style sheet.
What is CLDC ?
The Connected, Limited Device Configuration (CLDC) is a specification for a J2ME configuration. The
CLDC is for devices with less than 512 KB or RAM available for the Java system and an intermittent
(limited) network connection. It specifies a stripped-down Java virtual machine1 called the KVM as well as
several APIs for fundamental application services. Three packages are minimalist versions of the J2SE
java.lang, java.io, and java.util packages. A fourth package, javax.microedition.io, implements the Generic
Connection Framework, a generalized API for making network connections.
What is configuration ?
In J2ME, a configuration defines the minimum Java runtime environment for a family of devices: the
combination of a Java virtual machine (either the standard J2SE virtual machine or a much more limited
version called the CLDC VM) and a core set of APIs. CDC and CLDC are configurations. See also profile,
optional package.
What is CVM ?
The Compact Virtual Machine (CVM) is an optimized Java virtual machine1 (JVM) that is used by the
CDC.
What is Deck ?
A deck is a collection of one or more WML cards that can be downloaded, to a mobile phone, as a single
entity.
What is EDGE ?
Enhanced Data GSM Environment (EDGE) is a new, faster version of GSM. EDGE is designed to support
transfer rates up to 384Kbps and enable the delivery of video and other high-bandwidth applications.
EDGE is the result of a joint effort between TDMA operators, vendors and carriers and the GSM Alliance.
What is ETSI ?
The European Telecommunications Standards Institute (ETSI) is a non-profit organization that
establishes telecommunications standards for Europe.
What is FDMA ?
Frequency-division multiple-access (FDMA) is a mechanism for sharing a radio frequency band among
multiple users by dividing it into a number of smaller bands.
What is Foundation Profile ?
The Foundation Profile is a J2ME profile specification that builds on CDC. It adds additional classes and
interfaces to the CDC APIs but does not go so far as to specify user interface APIs, persistent storage, or
application life cycle. Other J2ME profiles build on the CDC/Foundation combination: for example, the
Personal Profile and the RMI Profile both build on the Foundation Profile.
What is Generic Connection Framework ?
The Generic Connection Framework (GCF) makes it easy for wireless devices to make network
connections. It is part of CLDC and CDC and resides in the javax.microedition.io package.
What is GPRS ?
The General Packet Radio System (GPRS) is the next generation of GSM. It will be the basis of 3G
networks in Europe and elsewhere.
What is GSM ?
The Global System for Mobile Communications (GSM) is a wireless network system that is widely used in
Europe, Asia, and Australia. GSM is used at three different frequencies: GSM900 and GSM1800 are
used in Europe, Asia, and Australia, while GSM1900 is deployed in North America and other parts of the
world.
What is HLR ?
The Home Location Register (HLR) is a database for permanent storage of subscriber data and service
profiles.
What is HTTPS ?
Hyper Text Transfer Protocol Secure sockets (HTTPS) is a protocol for transmission of encrypted
hypertext over Secure Sockets Layer.
What is i-appli ?
Sometimes called "Java for i-mode", i-appli is a Java environment based on CLDC. It is used on handsets
in NTT DoCoMo's i-mode service. While i-appli is similar to MIDP, it was developed before the MIDP
specification was finished and the two APIs are incompatible.
What is IDE ?
An Integrated Development Environment (IDE) provides a programming environment as a single
application. IDEs typically bundle a compiler, debugger, and GUI builder tog ether. Forte for Java is Sun's
Java IDE.
What is iDEN ?
The Integrated Dispatch Enhanced Network (iDEN) is a wireless network system developed by Motorola.
Various carriers support iDEN networks around the world: Nextel is one of the largest carriers, with
networks covering North and South America.
What is i-mode ?
A standard used by Japanese wireless devices to access cHTML (compact HTML) Web sites and display
animated GIFs and other multimedia content.
What is 3G ?
Third generation (3G) wireless networks will offer faster data transfer rates than current networks. The
first generation of wireless (1G) was analog cellular. The second generation (2G) is digital cellular,
featuring integrated voice and data communications. So-called 2.5G networks offer incremental speed
increases. 3G networks will offer dramatically improved data transfer rates, enabling new wireless
applications such as streaming media.
What is 3GPP ?
The 3rd Generation Partnership Project (3GPP) is a global collaboration between 6 partners: ARIB,
CWTS, ETSI, T1, TTA, and TTC. The group aims to develop a globally accepted 3rd-generation mobile
system based on GSM.
What is Java Card ?
The Java Card specification allows Java technology to run on smart cards and other small devices. The
Java Card API is compatible with formal international standards, such as, ISO7816, and industry-specific
standards, such as, Europay/Master Card/Visa (EMV).
What is JavaHQ ?
JavaHQ is the Java platform control center on your Palm OS device.
What is JCP ?
The Java Community Process (JCP) an open organization of international Java developers and licensees
who develop and revise Java technology specifications, reference implementations, and technology
compatibility kits through a formal process.
What is JDBC for CDC/FP ?
The JDBC Optional Package for CDC/Foundation Profile (JDBCOP for CDC/FP) is an API that enables
mobile Java applications to communicate with relational database servers using a subset of J2SE's Java
Database Connectivity. This optional package is a strict subset of JDBC 3.0 that excludes some of
JDBC's advanced and server-oriented features, such as pooled connections and array types. It's meant
for use with the Foundation Profile or its supersets.
What is JSR
Java Specification Request (JSR) is the actual description of proposed and final specifications for the
Java platform. JSRs are reviewed by the JCP and the public before a final release of a specification is
made.
What is KittyHawk
KittyHawk is a set of APIs used by LG Telecom on its IBook and p520 devices. KittyHawk is based on
CLDC. It is conceptually similar to MIDP but the two APIs are incompatible.
What is KJava
KJava is an outdated term for J2ME. It comes from an early package of Java software for PalmOS,
released at the 2000 JavaOne show. The classes for that release were packaged in the com.sun.kjava
package.
What is kSOAP
kSOAP is a SOAP API suitable for the J2ME, based on kXML.
What is kXML
The kXML project provides a small footprint XML parser that can be used with J2ME.
What is KVM
The KVM is a compact Java virtual machine (JVM) that is designed for small devices. It supports a subset
of the features of the JVM. For example, the KVM does not support floating-point operations and object
finalization. The CLDC specifies use of the KVM. According to folklore, the 'K' in KVM stands for kilobyte,
signifying that the KVM runs in kilobytes of memory as opposed to megabytes.
What is LAN
A Local Area Network (LAN) is a group of devices connected with various communications technologies
in a small geographic area. Ethernet is the most widely-used LAN technology. Communication on a LAN
can either be with Peer-to-Peer devices or Client-Server devices.
What is LCDUI
LCDUI is a shorthand way of referring to the MIDP user interface APIs, contained in the
javax.microedition.lcdui package. Strictly speaking, LCDUI stands for Liquid Crystal Display User
Interface. It's a user interface toolkit for small device screens which are commonly LCD screens.
What is MExE
The Mobile Execution Environment (MExE) is a specification created by the 3GPP which details an
applicatio n environment for next generation mobile devices. MExE consists of a variety of technologies
including WAP, J2ME, CLDC and MIDP.
What is MIDlet
A MIDlet is an application written for MIDP. MIDlet applications are subclasses of the
javax.microedition.midlet.MIDlet class that is defined by MIDP.
What is MIDlet suite
MIDlets are packaged and distributed as MIDlet suites. A MIDlet suite can contain one or more MIDlets.
The MIDlet suite consists of two files, an application descriptor file with a .jad extension and an archive
file with a .jar file. The descriptor lists the archive file name, the names and class names for each MIDlet
in the suite, and other information. The archive file contains the MIDlet classes and resource files.
What is MIDP
The Mobile Information Device Profile (MIDP) is a specification for a J2ME profile. It is layered on top of
CLDC and adds APIs for application life cycle, user interface, networking, and persistent storage.
What is MIDP-NG
The Next Generation MIDP specification is currently under development by the Java Community Process.
Planned improvements include XML parsing and cryptographic support.
What is Mobitex
Mobitex is a packet-switched, narrowband PCS network, designed for wide-area wireless data
communications. It was developed in 1984 by Eritel, an Ericsson subsidiary, a nd there are now over 30
Mobitex networks in operation worldwide.
What is Modulation ?
Modulation is the method by which a high-frequency digital signal is grafted onto a lower-frequency
analog wave, so that digital packets are able to ride piggyback on the analog airwave.
What is MSC ?
A Mobile Switching Center (MSC) is a unit within a cellular phone network that automatically coordinates
and switches calls in a given cell. It monitors each caller's signal strength, and when a signal begins to
fade, it hands off the call to another MSC that's better positioned to manage the call.
What is Obfuscation
Obfuscation is a technique used to complicate code. Obfuscation makes code harder to understand when
it is de-compiled, but it typically has no affect on the functionality of the code. Obfuscation programs can
be used to protect Java programs by making them harder to reverse-engineer.
What is optional package
An optional package is a set of J2ME APIs providing services in a specific area, such as database access
or multimedia. Unlike a profile, it does not define a complete application environment, but rather is used in
conjunction with a configuration or a profile. It extends the runtime environment to support device
capabilities that are not universal enough to be defined as part of a profile or that need to be shared by
different profiles. J2ME RMI and the Mobile Media RMI are examples of optional packages.
What is OTA
Over The Air (OTA) refers to any wireless networking technology.
What is PCS
Personal Communications Service (PCS) is a suite of second-generation, digitally modulated
mobile-communications interfaces that includes TDMA, CDMA, and GSM. PCS serves as an umbrella
term for second-generation wireless technologies operating in the 1900MHz range
What is PDAP
The Personal Digital Assistant Profile (PDAP) is a J2ME profile specification designed for small platforms
such as PalmOS devices. You can think of PDAs as being larger than mobile phones but smaller than
set-top boxes. PDAP is built on top of CLDC and will specify user interface and persistent storage APIs.
PDAP is currently being developed using the Java Community Process (JCP).
What is PDC
Personal Digital Cellular (PDC) is a Japanese standard for wireless communications.
What is PDCP
Parallel and Distributed Computing Practices (PDCP) are often used to describe computer systems that
are spread over many devices on a network (wired or wireless) where many nodes process data
simultaneously.
What is Personal Profile
The Personal Profile is a J2ME profile specification. Layered on the Foundation Profile and CDC, the
Personal Profile will be the next generation of PersonalJava technology. The specification is currently in
development under the Java Community Process (JCP).
What is PersonalJava
PersonalJava is a Java environment based on the Java virtual machine1 (JVM) and a set of APIs similar
to a JDK 1.1 environment. It includes the Touchable Look and Feel (also called Truffle), a graphic toolkit
that is optimized for consumer devices with a touch sensitive screen. PersonalJava will be included in
J2ME in the upcoming Personal Profile, which is built on CDC.
What is PNG
Portable Network Graphics (PNG) is an image format offering lossless compression and storage
flexibility. The MIDP specification requires implementations to recognize certain types of PNG images.
What is POSE
Palm OS Emulator (POSE).
What is PRC
Palm Resource Code (PRC) is the file format for Palm OS applications.
What is preverification
Due to memory and processing power available on a device, the verification process of classes are split
into two processes. The first process is the preverification which is off-device and done using the preverify
tool. The second process is verification which is done on-device.
What is profile
A profile is a set of APIs added to a configuration to support specific uses of a mobile device. Along with
its underlying configuration, a profile defines a complete, and usually self-contained, general-purpose
application environment. Profiles often, but not always, define APIs for user interface and persistence; the
MIDP profile, based on the CLDC configuration, fits this pattern. Profiles may be supersets or subsets of
other profiles; the Personal Basis Profile is a subset of the Personal Profile and a superset of the
Foundation Profile. See also configuration, optional package.
What is Provisioning ?
In telecommunications terms, provisioning means to provide telecommunications services to a user. This
includes providing all necessary hardware, software, and wiring or transmission devices.
What is PSTN ?
The public service telephone network (PSTN) is the traditional, land-line based system for exchanging
phone calls.
What is RMI
Remote method invocation (RMI) is a feature of J2SE that enables Java objects running in one virtual
machine to invoke methods of Java objects running in another virtual machine, seamlessly.
What is RMI OP
The RMI Optional Package (RMI OP) is a subset of J2SE 1.3's RMI functionality used in CDC-based
profiles that incorporate the Foundation Profile, such as the Personal Basis Profile and the Personal
Profile. The RMIOP cannot be used with CLDC-based profiles because they lack object serialization and
other important features found only in CDC-based profiles. RMIOP supports most of the J2SE RMI
functionality, including the Java Remote Method Protocol, marshalled objects, distributed garbage
collection, registry-based object lookup, and network class loading, but not HTTP tunneling or the Java
1.1 stub protocol.
What is RMI Profile
The RMI Profile is a J2ME profile specification designed to support Java's Remote Method Invocation
(RMI) distributed object system. Devices implementing the RMI Profile will be able to interoperate via RMI
with other Java devices, including Java 2, Standard Edition. The RMI Profile is based on the Foundation
Profile, which in turn is based on CDC.
What is RMS
The Record Management System (RMS) is a simple record-oriented database that allows a MIDlet to
persistently store information and retrieve it later. Different MIDlets can also use the RMS to share data.
What is SDK
A Software Development Kit (SDK) is a set of tools used to develop applications for a particular platform.
An SDK typically contains a compiler, linker, and debugger. It may also contain libraries and
documentation for APIs.
What is SIM
A Subscriber Identity Module (SIM) is a stripped-down smart card containing information about the
identity of a cell-phone subscriber, and subscriber authentication and service information. Because the
SIM uniquely identifies the subscriber and is portable among handsets, the user can move it from one
kind of phone to another, facilitating international roaming.
What is SMS
Short Message Service (SMS) is a point-to-point service similar to paging for sending text messages of
up to 160 characters to mobile phones.
What is SOAP
The Simple Object Access Protocol (SOAP) is an XML- based protocol that allows objects of any type to
communicated in a distributed environment. SOAP is used in developing Web Services.
What is SSL
Secure Sockets Layer (SSL) is a socket protocol that encrypts data sent over the network and provides
authentication for the socket endpoints.
What is T9
T9 is a text input method for mobile phones and other small devices. It replaces the "multi-tap" input
method by guessing the word that you are trying to enter. T9 may be embedded in a device by the
manufacturer. Note that even if the device supports T9, the Java implementation may or may not use it.
Check your documentation for details.
What is TDMA
Time Division Multiple Access (TDMA) is a second-generation modulation standard using bandwidth
allocated in the 800 MHz, 900 MHz, and 1900MHz ranges.
What is Telematics
Telematics is a location-based service that routes event notification and control data over wireless
networks to and from mobile devices installed in automobiles. Telematics makes use of GPS technology
to track vehicle latitude and longitude, and displays maps in LED consoles mounted in dashboards. It
connects to remote processing centers that turn provide server-side Internet and voice services, as well
as access to database resources.
What is Tomcat ?
Tomcat is a reference implementation of the Java servlet and JavaServer Pages (JSP) specifications. It is
intended as a platform for developing and testing servlets.
What is UDDI ?
Universal Description, Discovery, and Integration (UDDI) is an XML-based standard for describing,
publishing, and finding Web services. UDDI is a specification for a distributed registry of Web services.
What is UMTS
Developed by Nortel Networks, Universal Mobile Telecommunications Service (UMTS) is a standard that
will provide cellular users a consistent set of technologies no matter where they are located worldwide.
UMTS utilizes W-CDMA technology.
What is VLR
The Visitor Location Register (VLR) is a database that contains temporary information about subscribers.
What is WAE
The Wireless Application Environment (WAE) provides a application framework for small devices. WAE
leverages other technologies such as WAP, WTP, and WSP.
What is WAP
Wireless Application Protocol (WAP) is a protocol for transmitting data between servers and clients
(usually small wireless devices like mobile phones). WAP is analogous to HTTP in the World Wide Web.
Many mobile phones include WAP browser software to allow users access to Internet WAP sites.
What is WAP Gateway
A WAP Gateway acts as a bridge allowing WAP devices to communicate with other networks (namely the
Internet).
What is W-CDMA
Wideband Code-Division Multiple Access (W-CDMA), also known as IMT-2000, is a 3rd generation
wireless technology. Supports speeds up to 384Kbps on a wide-area network, or 2Mbps locally.
What is WDP
Wireless Datagram Protocol (WDP) works as the transport layer of WAP. WDP processes datagrams
from upper layers to formats required by different physical datapaths, bearers, that may be for example
GSM SMS or CDMA Packet Data. WDP is adapted to the bearers available in the device so upper layers
don't need to care about the physical level.
What is WMA
The Wireless Messaging API (WMA) is a set of classes for sending and receiving Short Message Service
messages. See also SMS.
What is WML
The Wireless Markup Language (WML) is a simple language used to create applications for small
wireless devices like mobile phones. WML is analogous to HTML in the World Wide Web.
What is WMLScript
WMLScript is a subset of the JavaScript scripting language designed as part of the WAP standard to
provide a convenient mechanism to access mobile phone's peripheral functions.
What is WSP
Wireless Session Protocol (WSP) implements session services of WAP. Sessions can be
connection-oriented and connectionless and they may be suspended and resumed at will.
What is WTLS
Wireless Transport Layer Security protocal (WTLS) does all cryptography oriented features of WAP.
WTLS handles encryption/decryption, user authentication and data integrity. WTLS is based on the fixed
network Transport Layer Security protocal (TLS), formerly known as Secure Sockets Layer (SSL).
What is WTP
Wireless Transaction Protocol (WTP) is WAP's transaction protocol that works between the session
protocol WSP and security protocol WTLS. WTP chops data packets into lower level datagrams and
concatenates received datagrams into useful data. WTP also keeps track of received and sent packets
and does re-transmissions and acknowledgment sending when needed.
XHTML Interview Questions and Answers
What is XHTML?
Answer1:
XHTML is a more formal, stricter version of HTML. XHTML is defined by an XML dtd which makes it much
easier to handle.
Answer2:
* XHTML stands for eXtensible Hyper Text Markup Language.
* It is aimed to replace HTML.
* It is almost identical to HTML 4.01
* It is the reformulation of HTML 4.01 as an application of XML.
* It is a stricter, tidier version of HTML.
XHTML 1.0 is the next level of coding as specified by the W3C.
XHTML is a transition / combination of HTML and XML. To change from HTML to XHTML requires just a
few changes in your coding styles. The main page to check out is CONVERTING but all the others
provide valuable information about this coding technique as well.
XHTML provides the framework for future extensions of HTML and aims to replace HTML in the future.
Some resources refer to XHTML as HTML5.
XHTML 1.0 became an official W3C recommendation on January 26, 2000. A W3C recommendation
means that the specification is stable, that it has been reviewed by the W3C membership, and that the
specification is now a Web standard.
XHTML 1.0 is the first step toward a modular and extensible web environment based on XML (eXtensible
Markup Language). It provides the bridge for web designers to use a future based coding and still be able
to maintain compatibility with today's browsers.
XHTML is a stricter and cleaner version of HTML.
Answer3:
* XHTML stands for EXtensible HyperText Markup Language
* XHTML is aimed to replace HTML
* XHTML is almost identical to HTML 4.01
* XHTML is a stricter and cleaner version of HTML
* XHTML is HTML defined as an XML application
* XHTML is a W3C Recommendation
XHTML is a combination of HTML and XML (EXtensible Markup Language).
XHTML consists of all the elements in HTML 4.01 combined with the syntax of XML.
Advantages of using XHTML instead of HTML
1. Documents can be validated much easier
2. Documents can be transformed via tools like XSLT into other documents for consumption by devices
like handhelds
3. Fragments of documents can be retrieved faster
4. Text can be stored more effieciently in object oriented databases
Answer4:
The great thing about XHTML, though, is that it is almost the same as HTML, although it is much more
important that you create your code correctly. You cannot make badly formed code to be XHTML
compatible. Unlike with HTML (where simple errors (like missing out a closing tag) are ignored by the
browser), XHTML code must be exactly how it is specified to be. This is due to the fact that browsers in
handheld devices etc. don't have the power to show badly formatted pages so XHTML makes sure that
the code is correct so that it can be used on any type of browser.
Answer54:
XHTML combines XML and HTML 4 to provide developers with a language that conforms to the XML
format, as opposed to HTML which is based on SGML. XML is much simpler to parse than SGML, and
standards exist such as XSLT, XPath, and XQuery for manipulating XML documents. Unfortunately,
support for XHTML in browsers is poor, with the leading browser, Microsoft Internet Explorer, not
supporting the XHTML mime type 'application/xhtml+xml'.
Why XHTML?
XHTML pages can be read by all XML enabled devices AND while waiting for the rest of the world to
upgrade to XML supported browsers, XHTML gives you the opportunity to write "well-formed" documents
now, that work in all browsers and that are backward browser compatible
Since 1990, HTML (or Hyper Text Markup Language) has been the language recommended for creating
Web pages. And it has been very successful . But HTML has its problems. Without going into specifics,
as it's not the subject of this article, HTML has become a mess. To sort this mess out, in 1999 the World
Wide Web Consortium came up with XHTML. XHTML stands for eXtended Hyper Text Markup Language,
and is written in a language called XML or eXtended Markup Language.
As the name implies, XHTML has the capability to be extended. You can use extra modules to do things
with your pages that weren't possible with HTML. The long-term goal is that your Web pages will be able
to be understood by computers as well as humans. How does this work? Allow me to explain.
You may be thinking that computers already understand Web pages because you use a computer to view
them. This is true. But computers only understand how to display your pages, not what they mean.
Imagine if computers did understand what Web pages meant! You could tell your computer to go and visit
all of your local supermarket's Websites and report back to you on which store is the cheapest for this
week's shopping. Your computer could visit the news sites around the world and bring back the latest
headlines that relate to things you're interested in. The possibilities are endless.
Differences between XML and HTML
Since XML and HTML are derived from SGML they are similar, but have the following differences:
1. XML is case-sensitive
2. XML must have quotes (single or double) around attributes
3. Most interpreters of HTML are very forgiving about missing end tags - XML parses are not.
4. Comments start with . Inside a comment, "--" may not appear. Although this is fine
in html, it confuses xml parsers.
How is XHTML better than HTML? Why would you want to use XHTML?
* to be able to take advantage of new coding techniques
* problems with the earlier versions have been fixed.
XHTML is a fairly close copy of HTML 4.01.
Extensibility : Under HTML, the addition of a new group of elements requires alteration of the entire DTD.
XML greatly eases the integration of new element collections as it is a subset of SGML itself and specifies
it's own DTD.
Portability : By the year 2002 as much as 75% of Internet access could be carried out on non-PC
platforms such as palm computers, televisions, fridges, automobiles, telephones, etc. In most cases these
devices will not have the computing power of a desktop computer, and will not be designed to
accommodate ill-formed HTML as do current browsers.
Currently, the Netscape browser helps greatly for testing web pages by displaying blank or broken pages
when it comes across sloppy coding. IE is the most forgiving browser and will show almost any page no
matter the extent of coding errors.
While HTML itself isn't completely lacking in extensibility or portability but the evolution of it has been
extremely slow compared to the pace of Internet development. This fuels the problems encountered
trying to make your pages work on a wide range of browsers and platforms. XHTML will help to remedy
those problems.
How To Get Ready For XHTML?
XHTML is not very different from HTML 4.01, so bringing your code up to the 4.01 standard is a good
start. In addition, you should start NOW to write your HTML code in lowercase letters.
.
The Most Important Differences:
* XHTML elements must be properly nested
* XHTML documents must be well-formed
* Tag names must be in lowercase
* All XHTML elements must be closed
Why Code Your Own XHTML?
Programs that produce HTML for you often do so badly, often producing Web pages that do things the
long way. When you code your pages by hand you have an intimate understanding of what you're doing,
and can make the actual size of the Web page file as small as possible. This decreases download times,
so your pages load faster and your users are happier.
When you use a program to generate HTML for you, you don't get the chance to understand how your
page is built internally because it's all done for you. This is not a problem as long as everything works…
but what if it doesn't? If you find that your Web page doesn't display properly in Internet Explorer 4, and
many of your users use that browser, you're going to have to sort it out. This means forgetting about the
program and looking at the code yourself. Will you see the problem? If you've been using the program to
code the page for you, when problems occur you probably won't have the knowledge you need to fix
them.
The Internet is no longer limited to people with computers viewing Websites through one or two different
Web browsers. Everything has a Web browser in it these days: mobile phones, televisions, personal
digital assistants, cars… even fridges! Blind users "view" Websites using speech synthesis or Braille
devices. There is no way you can test each page you produce in all the possible devices on which it may
be used.
But there is a way to ensure you have the best chance your site will work in most scenarios: to produce
pages using the standards laid out by the World Wide Web Consortium (W3C), the people who work on
XHTML and other Internet standards. The W3C provide a validation service to check that your page
meets the standards, and if it does, it therefore has the best chance of being used on any device.
How to build a "Hello World" page. With XHTML ?
"Hello World" Web page code looks like this:
Hello World
My first Web page.
Why XHTML Modularization?
The XHTML modularization model defines the modules of XHTML.
XHTML is a simple, but large language. XHTML contains most of the functionality a web developer will
need.
For some purposes XHTML is too large and complex, and for other purposes it is much too simple.
By splitting XHTML into modules, the W3C (World Wide web Consortium) has created small and
well-defined sets of XHTML elements that can be used separately for simple devices as well as combined
with other XML standards into larger and more complex applications.
With modular XHTML, product and application designers can:
* Choose the elements to be supported by a device using standard XHTML building blocks.
* Add extensions to XHTML, using XML, without breaking the XHTML standard.
* Simplify XHTML for devices like hand held computers, mobile phones, TV, and home appliances.
* Extend XHTML for complex applications by adding new XML functionality (like MathML, SVG, Voice and
Multimedia).
* Define XHTML profiles like XHTML Basic (a subset of XHTML for mobile devices).
What about elements that don't have a close tag, such as and ?
There are two solutions. You could use a close tag (e.g. ). However the best
solution is to simply include a forward slash in the element:
Will this work?
As long as you include a space before the slash it will cause no problems in most Web browsers -
although there have been reports of problems with some embedded HTML viewers such as Java's Swing
HTML editor.
Why do we need modular DTDs?
An application may wish to support only a subset of XHTML. For example a mobile phone, an Internet TV
or even a Web-aware cooker may only require a subset of XHTML. Also modularity makes it easier to
deploy new developments.
Any other important new developments?
Yes: XSLT provides a transformation language which can be used to transform XML documents into
other formats. XSLT can be used to transform documents from one XML DTD to another, or even to
transform an XML document to an alternative format such as RTF or PDF.
Why is this XSLT important?
You've heard all the hype about mobile phones and WAP haven't you? How do you think the WAP world,
which expects documents to be in WML format, to be populated? Rather than manually creating WML
markup, XSLT will enable XHTML documents to be automatically converted to WML.
XHTML should be the master storage format for my resources?
NO! XHTML still lacks semantics. Ideally your resources should be stored in an appropriate XML format.
XSLT can then be used to convert the resources to XHTML (for Web browsers), WML (for mobile
phones), etc. XHTML is a useful intermediate stage.
Can we get down to practicalities. How do I create XHTML pages?
The eGroups XHTML-L Web site provides links to XHTML tools, including conversion tools and editors. A
couple of free tools are available (HTML-Kit, 1st Page 2000). Mozquito Factory appears to be the first
licensed package on the market.
You can expect the usual suspects (Microsoft, Dreamweaver, etc) to bring out new versions of their
products with XHTML support.
What about conversion of existing HTML pages - especially bulk conversion, as I have many
thousands of HTML files!
W3C has written a utility program called Tidy which can be used to convert HTML pages to XHTML. Tidy
can be used in batch mode to bulk-convert documents. Tidy is an open source program, which has been
incorporated into an number of authoring tools, most notably HTML-Kit
What's the advantages of XHTML?
* Mixed namespaces
* Much simpler to work with (for programs, at least) than HTML
* You will immediately know when your document is not well-formed due to an error from your UA.
What the benefits of XHTML are?
As XHTML is an XML application, you will benefit from developments in the XML world. For example XML
tools such as editors, converters, browsers, etc. can be used with XHTML resources. In addition there are
developments to the XML family of protocols and formats which will provide additional functionality for
XHTML.
Attributes values must be in double or single quotes
becomes
or
Every element must have an end tag, even when it doesn't really matter.
becomes
For compatibility with older browsers its best to put a single space before the '/'. Some browsers have
trouble with "" so its best to use ""
How to convert most HTML pages to XHTML.
1. Heading lines at top
At the beginning of documents we need to include a few lines:
The location of the dtd allows validating parsers to check the document. Most browsers will ignore these
tags.
Every attribute must have a value
decline
becomes
decline
What the benefits of XHTML are?
As XHTML is an XML application, you will benefit from developments in the XML world. For example XML
tools such as editors, converters, browsers, etc. can be used with XHTML resources. In addition there are
developments to the XML family of protocols and formats which will provide additional functionality for
XHTML.
Attributes values must be in double or single quotes
becomes
or
Every element must have an end tag, even when it doesn't really matter.
becomes
For compatibility with older browsers its best to put a single space before the '/'. Some browsers have
trouble with "" so its best to use ""
How W3Schools Was Converted To XHTML ?
W3Schools was converted from HTML to XHTML.
To convert a Web site from HTML to XHTML, you should be familiar with the XHTML syntax rules.
Your pages must have a DOCTYPE declaration if you want them to validate as correct XHTML.
The following DOCTYPE declaration was added as the first line of every page:
Be aware however, that newer browsers might treat your document differently depending on the
declaration. If the browser reads a document with a DOCTYPE, it might treat the document
as "correct". Malformed XHTML might fall over and display differently than without a DOCTYPE.
Lower Case Tag And Attribute Names
Since XHTML is case sensitive, and since XHTML only accepts lower case HTML tags and attribute
names, a general search and replace function was executed to replace all upper case tags with
lowercase tags. The same was done for attribute names. We have always tried to use lower case names
in our Web, so the replace function did not produce many real substitutions.
All Attributes Were Quoted
Since the W3C XHTML 1.0 Recommendation states that all attribute values must be quoted, every page
in the web was checked to see that attributes values were properly quoted. This was a time-consuming
job, and we will surely never again forget to put quotes around our attribute values.
Empty Tags: , and
Empty tags are not allowed in XHTML. The and tags should be replaced with and .
This produced a problem with Netscape that misinterpreted the tag. We don't know why, but
changing it to worked fine. After that discovery, a general search and replace function was
executed to swap the tags.
A few other tags (like the tag) were suffering from the same problem as above. We decided not to
close the tags with , but with /> at the end of the tag. This was done manually.
The Web Site Was Validated
After that, all pages were validated against the official W3C DTD with this link: XHTML Validator. A few
more errors were found and edited manually. The most common error was missing tags in lists.
Downcase HTML tags, attributes, and HTML defined values
becomes
(Capitols are ok in user defined attribute values like .)
What XHTML does it stand for? How is if different from HTML? Who developed it? ?
XHTML stands for "Extensible HyperText Markup Language". It was developed by the World Wide Web
Consortium (W3C) and is now a W3C Recommendation.
XHTML is a reformulation of HTML 4 in XML 1.0. This means that the benefits provided by XML will be
available to XHTML.
How does HTML differ from XHTML ?
XHTML has a small number of differences. The most noticeable being the requirement for elements to be
lowercase (e.g. and not ) and elements to be closed (e.g. paragraphs must end with a ).
Why to type a tags in uppercase, and never bother closing the paragraphs ?
For reasons on internationalisation XML elements are case sensitive. A choice had to be made, and
lowercase won on the day.
Tags may not overlap
This is emphasized text and bold text
becomes
This is emphasized text is bold text
Only certain tags may nest inside other tags
Looking at the dtd for xhtml, the definition of the "ol" element is:
This implies that an order list, "ol", element may not contain paragraph tags or body text, just list items.
These are some of my favorite animals:
octopus
shrew
lemur
and my most favorite
meerkats
becomes
These are some of my favorite animals:
octopus
shrew
lemur
meerkats