Hypertext Markup Language


On the mainframe, you built COBOL CICS screens and you loved what basic mapping support (BMS) mapsets could do for you. Maybe you coded your BMS mapsets manually or maybe you were fortunate enough to have a screen-painting tool that built the mapsets for you. Either way, the concept of designing a screen and assigning attributes to field positions (i.e., length, color , and so on) is something very familiar to you. Well, CICS/BMS, scoot over and make room for Hypertext Markup Language (HTML).

HTML is one of the main languages that you will be working with (directly and indirectly) when you develop the graphical user interface (GUI) portions of Web pages. When you develop Web pages, not only will you have an opportunity to set "field" attributes (font sizes, text color, and so on), but you will also build entire user interface features. In some cases, you will take full advantage of a screen-painting tool (Visual Studio .NET or other software) that will create the HTML code for you. In other cases, you will need to manually modify the HTML code. HTML (currently version 4.01) is used to present documents and information in all types of browsers. Thanks to the World Wide Web Consortium (W3C), HTML is an accepted standard. HTML is multivendor-, multibrowser-, and multiplatform -friendly.

Please familiarize yourself with the following basic HTML terminology:

  • Publishing: When HTML files (and ASP.NET files) are deployed to a Web server and made available to the public, publishing has taken place.

  • Content: HTML is not just about showing different types of fonts on Web pages. Most often, a company or organization is presenting valuable information, documents, and graphics on their Web pages. The HTML formatting tags and the text information, documents, and graphics are referred to collectively as content.

  • Authoring: Someone needs to create the content for the Web site, a process that is referred to as authoring. Authoring is the task of the Web author.

  • Rendering: When a client browser makes an HTTP request for an HTML page, the Web server [9] "delivers" the file to the browser. The HTML file and all of the HTML tags contained within the file are then "interpreted" by the browser [10 ] and the results are shown to the client. In this context, "rendering" and "HTML browser interpretation" are synonymous.

  • Tags/elements/attributes: These terms refer to the predefined syntax used to build an HTML file. Each represents the code and values you use to control things such as font size and color, background pattern, buttons , input fields, and structure.

  • Cascading Style Sheets (CSS): Rather than repeatedly apply the same detailed format information in separate HTML tags and/or separate HTML files, you can create a style sheet. The style sheet contains groups of format styles. Depending on the type of style sheet (local, global, or linked), your multiple HTML tags and files can then inherit the formatting rules specified by your style sheet and the appropriate format style group . The cascading effect follows a simple rule of precedence (first local, then global, and finally linked). Style sheets provide a way to separate the presentation of content from the content itself. Although you can also use CSS with XML, there is yet another type of style sheet syntax, Extensible Stylesheet Language Transformations (XSLT), which is available for XML programmers. CSS and XSLT serve similar purposes. However, they are not the same thing. Later in this chapter, I discuss XML and XSLT in more detail.

    Cross-Reference  

    The W3C has more information available regarding the CSS Recommendations at http://www.w3.org/Style/ .

  • Tables: Adding tables to a page is a common technique to assist with the organization/structure of content on a page.

  • Frames : You have choices about how to build your Web pages. For example, you may choose to divide your page into various frames. This is useful when you want to make only a portion of your screen scrollable.

Using your browser, navigate to any Web site or HTML page of your choice (see Figure 4-3 for an example). Then select View Source from your browser window to view the HTML (shown in Figure 4-4) that is behind the page of the Web site. Viewing the HTML code of Web pages can help you discover new HTML coding techniques.

click to expand
Figure 4-3: Sample HTML rendered in the Internet Explorer browser window
click to expand
Figure 4-4: Sample HTML as text data in the Notepad editor

Though the HTML in Figure 4-4 is displayed using Notepad, you could create your own HTML files in Notepad. However, you would be missing out on a lot of great editing enhancements that are available to you. Among many other things, Visual Studio .NET (VS .NET) includes a great editor. [11] This will mean much more to you when you are creating your ASP.NET Web applications and occasionally (with confidence) tweaking the HTML code.

Cross-Reference  

You can find more information on the W3C's HTML Recommendation at http://www.w3.org/MarkUp/ .

start sidebar
The Future of HTML: XHTML

The W3C is now working on the "extension" of HTML: XHTML. They have improved HTML by making it follow some of guidelines that XML follows. Due to sheer volume of the lines of HTML code in existence (responsible for the entire world's Web pages), the move toward XHTML is likely to be slow, not to mention difficult with regard to the cost of justifying a rewrite. Either way, you can adopt XHTML-type habits when you code your HTML files today, which will result in better HTML coding.

Visit the W3C Web site for more information about the XHTML Recommendation: http://www.w3.org/TR/xhtml1 .

end sidebar
 

Eventually, after you become an HTML expert, you will want to add logic to your Web pages. Perhaps you will want to add simple input validation to your Web pages. When you reach that point, you will want to explore the topic of client-side scripting. For your convenience, the next section serves to point you in the right direction.

[9] This basic explanation deals just with "static" HTML pages. In a later chapter (Chapter 14), I discuss Active Server Pages (ASP.NET). With ASP.NET, pages take on a more dynamic nature. The Web server processes the ASP.NET page before sending the resulting HTML page to the client browser.

[10 ] If there was a client-side script (VBScript, JavaScript, or JScript), the interpretation of the script would also occur at this point. In the next section in this chapter, I discuss client-side scripting.

[11] Generally, if a person prefers a tool designed just for Web page design/publishing (minus all of the great power that programming brings ), that person might choose one of the following products to author Web content: WYSIWYG, Dreamweaver 4.0, GoLive 5.0, FrontPage 2002, or Microsoft Publisher.




COBOL and Visual Basic on .NET
COBOL and Visual Basic on .NET: A Guide for the Reformed Mainframe Programmer
ISBN: 1590590481
EAN: 2147483647
Year: 2003
Pages: 204

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