Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Internet Librarian International Birmingham, UK Authoring Web Sites in XHTML Darlene Fichter [email protected] University of Saskatchewan Library Canada 26 March, 2003 Overview Frameworks Portlets Why use XHTML? XHTML syntax How XHTML differs from HTML XHTML and CSS XHTML tools Yesterday Today Computer - Device Web Page Static HTML hand coding HTML Tag Editors HTML, Forms, Client Side Scripts WSIWYG & Management Tools Distributed Authoring Web Site Dynamic / Database SQL & Perl/PHP/ASP CMS Authoring & workflow Web Services Portals & Personalization “My Library” Objects - XML Portals & Portlets Web Services XML, SOAP Content Challenges in 2003: Document Collections Storage & Management Content Structure Work Ease of use Ease of creation Good retrieval Service Challenges Just in Time Repackaging Over the Long Term Preservation Migration HTML Simple, general-purpose document markup language Simple hyperlinking Designed for collaborative authoring Combined authoring and viewing roles HTML Strengths Open standard Lots of tools and applications Easy and cheap Rapidly adopted HTML Weaknesses Not extensible Supports only “simple” document types Mixes presentation and structure Cross-browser wars XML More meaningful searches Flexible web applications data from disparate sources/applications client processing multiple views granular updates Open standard Unicode Hope --> good for web delivery What is XHTML? Called “Next generation” HTML HTML that conforms to XML standards Will eventually support integration with other XML applications Device independent web access Why use XHTML? Most documents on the Internet are in HTML – this is the logical next step Simpler than XML for most authors XHTML documents are XML compliant, which allows you to use XML tools such as XSL Future -- XHTML easier than HTML with the next generation of browsers Why do We Need XHTML? Both HTML and SGML have major drawbacks. XML’s use for encoding web documents is still at early stages of adoption Benefits of Adoption Easier to develop software Process data using inexpensive software Allows greater end-user control of information display handle specialized information distributed over the Web stylesheets Metadata for resource discovery XHTML - What does it take? All documents must have a doctype declaration The transitional doctype declaration-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/transitional. dtd"> Head and body Syntax XHTML – 3 Variations Strict Transitional <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/strict.dtd"> Used when CSS is used for all your formatting <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/transitional.dtd"> Frameset <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/frameset.dtd"> Syntax: Lower case Case matters HTML: <Title> or <TITLE> or <title> XHTML: <title> Syntax: Attributes Attributes must be quoted HTML <p class=quotes> XHTML <p class=“quotes”> Syntax: Close Elements All tags must be closed HTML: <p>Le chien dort. <p>La chat joue. XHTML: <p>Le chien dort. </p><p>La chat joue.</p> Syntax: Empty Elements Empty elements must be terminated HTML: <br> XHTML: <br /> Elements Must Be Nested <bigdoll> <mediumdoll> <littledoll> <littlestdoll/> </littledoll> <mediumdoll> </bigdoll> Scripts <script> and <style> tags must be marked as CDATA <script> <!-- <![CDATA] (script) ]]> - -> </script> Tip: Place your scripts in a external file. Use entities for all ampersands <a href="http://www.lights.ca/ cgi-bin/script.cgi?what=chien&id=9"> <a href="http://www.lights.ca/ cgi-bin/script.cgi?what=chien& id=9"> Style Sheets & XHTML The use of external style sheets is recommended <link rel="stylesheet" type="text/css" href=“lib.css" /> The type attribute is mandatory for <style> tag – text/css Enclose inline styles with <![CDATA[ and the ending tag ]]> Find Out More: XHTML syntax W3C http://www.w3.org/TR/xhtml1/ XHTML: le web devient coopératif XHTML.org http://www.xhtml.net/ http://www.xhtml.org Darlene Fichter. “Web Authoring in XHTML”. ONLINE Magazine November/December 2002 www.findarticles.com What about conversion? HTMLTidy http://www.w3.org/People/Raggett/tidy/ Resources for Conversion Converting HTML documents to XHTML by Bejoy Alex Jaison http://www22.brinkster.com/beeand nee/techzone/articles/htmltoxhtml.a sp Roy Tennant. XML for Libraries. Neal-Schuman Publishers, 2002. XHTML Validators Validator http://validator.w3.org/ Typical Web Author XHTML is available in standard tools Macromedia Dreamweaver HTML-Kit Macromedia HomeSite 5 NoteTab Pro Content Provider Usually authoring in Word Import in Dreamweaver Run it through a program like HTML TIDY New York Public Library www.nypl.org/styleguide/ Major Project Consider the value of the content over the long term Likelihood of delivery to “appliances” If there is an XML “dialect”, use it If not, use XHTML (ideally XML rendered as XHTML) Example: Law Cases 1994 2001 527 law cases edited, and formatted as HTML rigourous coding rules, poor validation Cost: $150,000 converted to XML, DTD creation, enhanced, rendered as XHTML Cost: $15,000 Future Cost < $300 Canadian Native Law Cases http;// library.usask.ca/native/cnlch.html Developers Repackaging, reuse, migration, archiving Code How long will this content be around? Always wise to separate presentation from content Decision/Balance Short term pain/effort vs. long term gain? XHTML & You XHTML will make your life a little more challenging XHTML will make your computer happier (eventually) Silver Bullets? XHTML / XML No! In fact, these new choices just raise some interesting challenges Only certainty is change Content will outlive devices! Thank you! Darlene Fichter [email protected] University of Saskatchewan Library