Extending Public XHTML DTDs

In the previous section, I created a new DTD to extend XHTML, and I put it to work in an XHTML document like this:

 <?xml version="1.0"?>  <?xml-stylesheet type="text/css" href="ch17_19.css"?>  <!DOCTYPE html SYSTEM "ch17_17.dtd">  <html xmlns="ch17_17.dtd" xml:lang="en" lang="en">     <head>         <title>         </title>     </head>     <body>         <p>             This text uses a new XHTML element for             <underlinedredtext>emphasis</underlinedredtext>.         </p>     </body> </html> 

In this case, I declared a local DTD for private use with the SYSTEM keyword. You can also make your DTD public with the PUBLIC keyword, but to do that, you've got to create a formal public identifier (FPI). Here are the rules for FPIs:

  • The first field in an FPI specifies the connection of the DTD to a formal standard. For DTDs that you're defining yourself, this field should be [ms] . If a nonstandards body has approved the DTD, use + . For formal standards, this field is a reference to the standard itself (such as ISO/IEC 13449:2000 ).

  • The second field must hold the name of the group or person that is going to maintain or be responsible for the DTD. In this case, you should use a name that is unique and that identifies your group easily (for example, the W3C simply uses W3C ).

  • The third field must indicate the type of document that is described, preferably followed by a unique identifier of some kind (such as Version 1.0 ). This part should include a version number that you'll update.

  • The fourth field specifies the language your DTD uses (for example, for English you use EN ). Note that two-letter language specifiers allow only a maximum of 24 x 24 = 576 possible languages. Expect to see three-letter language specifiers in the near future.

  • Fields in an FPI must be separated by a double slash ( // ).

You can put these rules to work, changing the previous example to indicate that the DTD we're using is publicly available, like this:

Listing ch17_21.xml
 <?xml version="1.0"?> <?xml-stylesheet type="text/css" href="ch17_19.css"?>  <!DOCTYPE html PUBLIC "-//starpowder//ELEMENTS XHTML-Custom 1.0//EN"  "http://www.starpowder.com/DTDs/ch17_17.dtd"> <html xmlns="http://www.starpowder.com/DTDs/ch17_17.dtd" xml:lang="en" lang="en">     <head>         <title>         </title>     </head>     <body>         <p>             This text uses a new XHTML element for             <underlinedredtext>emphasis</underlinedredtext>.         </p>     </body> </html> 


Real World XML
Real World XML (2nd Edition)
ISBN: 0735712867
EAN: 2147483647
Year: 2005
Pages: 440
Authors: Steve Holzner

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net