Sunday 8 July 2012

FPI


FPI


When declaring a DTD available for public use, you need to use the PUBLIC keyword within 

your DOCTYPE declaration. When you use the PUBLIC keyword, you also need to use an FPI 

(which stands for Formal Public Identifier).



FPI Syntax

An FPI is made up of 4 fields, each separated by double forward slashes (//):

field 1//field 2//field 3//field 4
FPI Example

Here's a real life example of an FPI. In this case, the DTD was created by the W3C for XHTML:

-//W3C//DTD XHTML 1.0 Transitional//EN
FPI Fields

An FPI must contain the following fields:

Field
Example
Description
Separator
//
This is used to separate the different fields of the FPI.
First field
-
Indicates whether the DTD is connected to a formal 
standard or not. If the DTD hasn't been approved (for 
example, you've defined the DTD yourself), use a 
hypen (-). If the DTD has been approved by a 
nonstandards body, use a plus sign "+". If the DTD 
has been approved by a formal standards body this 
field should be a reference to the standard itself.
Second 
field
W3C
Holds the name of the group (or person) responsible 
for the DTD. The above example is maintained by the 
W3C, so "W3C" appears in the second field.
Third field
DTD XHTML 1.0 Transitional
Indicates the type of document that is being
 described. This usually contains some form of unique 
identifier (such as a version number).
Fourth 
field
EN

Specifies the language that the DTD uses. This is 
achieved by using the two letter identifier for the 
language (i.e. for english, use "EN").



FPI DOCTYPE Syntax

When using a public DTD, place the FPI between the PUBLIC keyword and the URI/URL.

<!DOCTYPE rootname PUBLIC FPI URL>
FPI DOCTYPE Example

You can see an example of an FPI in the following DOCTYPE declaration (the FPI is in bold):

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

No comments:

Post a Comment