spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / javascript / column103


Web Services, Part VIII: Reading DTDs with JavaScript

Vice President of Risk Technology - READY TO HIRE! (NYC)
Next Step Systems
US-NY-New York

Justtechjobs.com Post A Job | Post A Resume
Developer News
News Flash: Adobe Has iPhone Workaround
Adobe's Flash 10.1 Goes Mobile (Minus iPhone)
A Salute to Visionary CEOs


Loading DTDs with the Browser

Let's see the entity reference substitution in action. There are three types of documents involved in our demo: XML, DTD, and XSL. The XML file includes the data itself. The DTD defines the data file structure and reference substitution. The XSL file converts the data to HTML. We discussed how to write the XSL file in Column 100. Try it now. You should get the following window:

Notice how the entity reference &month; was substitute by April, and &preparedby; was substituted by John Smith. Also notice that the single-character entity references &lt; and &gt; around April got substituted by < and >, respectively.

When reading an XML file with your browser, you can use the DTD file only to define reference substitution, and not for defining the whole document structure, as we did above. Consider the following short DTD file:

<!ENTITY preparedby "John Smith">
<!ENTITY month "April">
<!ENTITY day "Monday, ">

The file mydvd8.xml calls this DTD. Try it. You should get the same output as above.


Next: How to load DTDs with JavaScript

http://www.internet.com

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Building a Banking Application Home Page with OOP · Mixing Scripting Languages · Review: phpFox, a Social Networking CMS with all the Bells and Whistles
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Enterprise 2.0: Social Networking in the Cloud · BroadSoft Marketplace Hastens Pace of Telephony Innovation · Review: HTC Hero for Sprint


Produced by Yehuda Shiran and Tomer Shiran
All Rights Reserved. Legal Notices.
Created: February 11, 2002
Revised: February 11, 2002

URL: http://www.webreference.com/js/column103/***PASTE FILENAME HERE***