Items related to CodeNotes for XML

Gregory Brill CodeNotes for XML ISBN 13: 9780812991918

CodeNotes for XML - Softcover

 
9780812991918: CodeNotes for XML

Synopsis

CodeNotes provides the most succinct, accurate, and speedy way for a developer to ramp up on a new technology or language. Unlike other programming books, CodeNotes drills down to the core aspects of a technology, focusing on the key elements needed in order to understand it quickly and implement it immediately. It is a unique resource for developers, filling the gap between comprehensive manuals and pocket references.

CodeNotes for XML
is a practical handbook for Java and Visual Basic developers interested in working with XML. You will learn how to leverage both CSS and XSLT to produce rich, compelling output, as well as manipulate XML using the DOM and SAX APIs. The new XML Schema specification is also covered in-depth. Companion articles on www.codenotes.com cover XML development with Perl, integrating XML with databases, important grammars such as XHTML and SOAP, and much more. CodeNotes for XML is your guide to these powerful technologies, presented within the context of the distributed application, database, or web-based world you already know.

This edition of CodeNotes includes:

-A global overview of a technology and explanation of what problems it can be used to solve
-Real-world examples
-"How and Why" and "Bugs and Caveats" sections that provide hints, tricks, workarounds, and tips on what should be taken advantage of or avoided
-Instructions and classroom-style tutorials throughout from expert trainers and software developers.

Visit www.codenotes.com for updates, source code templates, access to message boards, and discussion of specific problems with CodeNotes authors and other developers.

Every CodeNotes title is written and reviewed by a team of commercial software developers and technology experts. See "About the Authors" for more information.

"synopsis" may belong to another edition of this title.

About the Author

Gregory Brill is the series editor of CodeNotes and the founder and president of Infusion Development Corporation, a technology training and consulting firm that specializes in architecting securities trading and analytic systems for several of the world’s largest investment banks. He has written for C++ Users Journal, and is the author of Applying COM+. He lives in New York.

From the Inside Flap

tes</b> provides the most succinct, accurate, and speedy way for a developer to ramp up on a new technology or language. Unlike other programming books, <b>CodeNotes</b> drills down to the core aspects of a technology, focusing on the key elements needed in order to understand it quickly and implement it immediately. It is a unique resource for developers, filling the gap between comprehensive manuals and pocket references.<br><b><i><br></i>CodeNotes for XML</b><i> </i>is a practical handbook for Java and Visual Basic developers interested in working with XML. You will learn how to leverage both CSS and XSLT to produce rich, compelling output, as well as manipulate XML using the DOM and SAX APIs. The new XML Schema specification is also covered in-depth. Companion articles on www.codenotes.com cover XML development with Perl, integrating XML with databases, important grammars such as XHTML and SOAP, and much more. <b>CodeNotes for XML</b> is your guide to these

Excerpt. © Reprinted by permission. All rights reserved.

Chapter 1: Introduction
Orientation

What Is XML?

Extensible Markup Language (XML) is a globally accepted, vendor- independent standard for representing structured, text-based data. An XML document is a perfect medium in which to encapsulate any kind of information that can be arranged or structured in some way. For example, an XML document can contain a list of personal or business contacts, books in a library’s card catalogue, or products in a warehouse.

If we looked at any one of these examples—say, the library card catalogue—in the more traditional “table-oriented” view with which most developers would be familiar, we would see something like the following:

book_isbnbook_genreFirstnamemiddlenameLastnametitle

0812589041Science OrsonScottCardEnder’s FictionGame

0883853280biographyWilliamDunhamEuler: The

Master of Us All


An XML document, on the other hand, would present this information hierarchically, where the column names would become tags or possibly “attributes.” For example:

<?xml version="1.0"?>

<books>

<book>

<isbn>0812589041</isbn>

<genre>science fiction</genre>

<author>

<firstname>Orson</firstname>

<middlename>Scott</middlename>

<lastname>Card</lastname>

</author>

<title>Enders Game</title>

<year>1985</year>

</book>

<book>

<isbn>0883853280</isbn>

<genre>biography</genre>

<author>

<firstname>William</firstname>

<middlename/>

<lastname>Dunham</lastname>

</author>

<title>Euler The Master of Us All</title>

<year>1999</year>

</book>

</books>



Listing 1.1 is included to give you a first look at XML, which can be overwhelming compared to a familiar table structure. However, as you become more familiar with XML, you will see that this structure has many important advantages over a traditional table.

XML and HTML

It can help to think of XML at its most basic level as being very similar to a HyperText Markup Language (HTML) web page. However, the tags in an XML document do not have a fixed meaning the way they do in HTML (e.g., <bold>, <body>, etc.) When a developer writes an XML document, he or she decides on the names of the elements (e.g., book, title, year, and author) and the data the elements will contain (e.g., the <year> tags contain the year the book was published). The developer chooses his elements with the expectation that some client application exists that will read the XML file and be written to process those particular elements in some way. Referring back to Listing 1.1, one can imagine that there is a book-search software application running on a computer in the library that reads XML files with this structure (perhaps receiving them via the Web from some central server), allowing library patrons to search for the books they wish to check out.

What Is XML Used For?

One misconception regarding XML is that it is simply an alternate way of transporting and storing data. However, that is only one small facet of how XML is used today. To give only a few examples, XML can be used to:

-invoke methods on a remote server through a firewall (this protocol is called SOAP)

-represent relational database data such that it can be easily translated into HTML, viewable by any browser without programming

-store configuration and deployment data for applications, providing operating-system-independent formats for initialization/configuration files

-create template documents describing the various fields and attributes of a business form

XML Tools and Technologies

In spite of its power and wide range of uses, XML itself is very straightforward. The more subtle aspects of XML do not have to do with XML itself, but rather with various third-party applications and technologies such as XML editors and authoring tools, and XML-related APIs.

XML Authoring Tools

XML files can become very large and may have many layers of nested elements. While the basic grammar of XML is relatively simple, finding a deeply buried element in a large document, or resolving a missed “/” or mismatched tag will very quickly try the patience of most software developers. Therefore, many tools have been developed to address this need. One can, of course, work with any simple text editor, but you can find a listing of some popular XML authoring tools in Chapter 3.

Translation and Styling

In addition to applications that make writing XML documents easier, there are a number of technologies that can actually extend XML’s capabilities. Most web browsers are capable of displaying XML files. Internet Explorer, for example, will show an XML file as a dynamic collapsible tree much like a simple Windows File Explorer; you can click on nodes to open them and reveal their child elements, or close them to get to a top-level view of the XML document. Suppose, however, you would like your XML document to display just like a web page with proper formatting and, perhaps, a colored background? There are two ways to do this:

1. Cascading Style Sheets (CSS): CSS files are text files containing format information. CSS is an older technology developed for HTML and uses a specialized scripting language.

2. Extensible Stylesheet Language Transformations (XSLT): Where CSS files are written in a specialized script language, XSLT documents are actually written in XML. An XSLT file maps XML elements into HTML tags and, in so doing, an XSLT file is used to actually translate an XML file into an HTML file.

The separation of data and presentation using either technology allows for a much cleaner and more efficient application design.

Querying

While the XML specification defines a structure for encapsulating data, it does not have any prescribed method for querying the data in an XML document. A technology known as XPath, however, does provide a mechanism for querying an XML file. If you are familiar with relational databases, you can think of XPath as XML’s much less sophisticated brand of SQL (Structured Query Language). By way of example, the XPath expression [/stocks/stock[1.0 > @price/text()]] will return all penny stocks from an appropriately structured XML file.

Programming with XML

In order to read an XML document, an application must parse it. The process of parsing is complex; a parser must take a text document, cut it up into meaningful segments (while making certain that these segments are correctly formed and that they conform to the rules of the language), and store the data and elements in memory. Writing a proper parser for any language or grammar is no easy task, and XML would not have caught on as a standard unless there also existed a freely available parser with a friendly programming interface to relieve the developer of this task. Fortunately, there are two: The Simple API for XML (SAX) and the Document Object Model (DOM). Ultimately, a developer can use either API to read an XML file and extract data from it. The approach taken by each of these two APIs, however, is different, as follows:

-DOM is a passive API. DOM reads an entire XML document, creates a tree structure in memory, and gives the developer read and write access to this tree. DOM must process the entire file and bring it into memory before a developer may access it.

-SAX is an active API. SAX will actually call methods on your application (or fire events) as it moves through the XML document. You can think of SAX as adhering to an event-driven model, triggering events in your application whenever it encounters anything important your application needs to know about, such as an element, text data, etc. Note that SAX does not allow modification of the XML document.

DOM and SAX are two different APIs useful for parsing, reading, and (to a small extent in the case of DOM) manipulating XML. Each API has strengths and weaknesses that will be explained in Chapters 6 and 7.

Integrating XML with Your World

XML’s popularity is due to the sheer usefulness of the technology. By defining a standard, vendor-independent format that can represent any kind of data, the uses for XML are boundless. Database vendors have taken notice of XML and are making their systems XML-friendly.

You may recall from the earlier section in this chapter, “Translation and Styling,” that an XML file can easily be translated to HTML via XSLT. The simplicity of this translation technology makes XML an ideal way to return data from a database since it can so easily be translated into a web-based report. CSS or additional XSLT can then be used to further enhance the appearance of the HTML page. As we will see, database vendors are quick to take advantage of these capabilities.

Upcoming XML Technologies

The XML family of technologies represents a tremendously fast-moving field where products, capabilities, and interoperability change daily. New standards are on the way for areas such as vector graphics (SVG), distributed computing (SOAP), and changes to HTML (XHTML). In addition, many industries have embraced XML as a standard for communicating specific types of information. For example, the financial industry is slowly accepting FIXML as a standard for transmitting financial information between institutions. In the next few years, you should expect to see many more standards that are based directly on XML.

"About this title" may belong to another edition of this title.

  • PublisherRandom House Trade Paperbacks
  • Publication date2002
  • ISBN 10 0812991915
  • ISBN 13 9780812991918
  • BindingPaperback
  • LanguageEnglish
  • Number of pages256

Buy Used

Condition: Good
Good condition. A copy that has...
View this item

FREE shipping within U.S.A.

Destination, rates & speeds

Search results for CodeNotes for XML

Stock Image

Gregory Brill
Published by Random House Trade Paperbacks, 2002
ISBN 10: 0812991915 ISBN 13: 9780812991918
Used Softcover

Seller: Wonder Book, Frederick, MD, U.S.A.

Seller rating 5 out of 5 stars 5-star rating, Learn more about seller ratings

Condition: Good. Good condition. A copy that has been read but remains intact. May contain markings such as bookplates, stamps, limited notes and highlighting, or a few light stains. Bundled media such as CDs, DVDs, floppy disks or access codes may not be included. Seller Inventory # Y10J-00726

Contact seller

Buy Used

US$ 5.79
Convert currency
Shipping: FREE
Within U.S.A.
Destination, rates & speeds

Quantity: 1 available

Add to basket

Stock Image

Gregory Brill
Published by Random House Trade Paperbacks, 2002
ISBN 10: 0812991915 ISBN 13: 9780812991918
Used Softcover

Seller: Wonder Book, Frederick, MD, U.S.A.

Seller rating 5 out of 5 stars 5-star rating, Learn more about seller ratings

Condition: Very Good. Very Good condition. A copy that may have a few cosmetic defects. May also contain a few markings such as an owner's name, short gifter's inscription or light stamp. Seller Inventory # U11J-00085

Contact seller

Buy Used

US$ 5.79
Convert currency
Shipping: FREE
Within U.S.A.
Destination, rates & speeds

Quantity: 1 available

Add to basket

Stock Image

Gregory Brill
Published by Random House Trade Paperbacks, 2002
ISBN 10: 0812991915 ISBN 13: 9780812991918
Used Softcover

Seller: More Than Words, Waltham, MA, U.S.A.

Seller rating 5 out of 5 stars 5-star rating, Learn more about seller ratings

Condition: Good. . . All orders guaranteed and ship within 24 hours. Before placing your order for please contact us for confirmation on the book's binding. Check out our other listings to add to your order for discounted shipping. Seller Inventory # BOS-P-13g-01339

Contact seller

Buy Used

US$ 1.97
Convert currency
Shipping: US$ 3.99
Within U.S.A.
Destination, rates & speeds

Quantity: 1 available

Add to basket

Stock Image

Gregory Brill
Published by Random House Trade, 2002
ISBN 10: 0812991915 ISBN 13: 9780812991918
Used Paperback

Seller: ThriftBooks-Dallas, Dallas, TX, U.S.A.

Seller rating 5 out of 5 stars 5-star rating, Learn more about seller ratings

Paperback. Condition: Very Good. No Jacket. May have limited writing in cover pages. Pages are unmarked. ~ ThriftBooks: Read More, Spend Less 0.7. Seller Inventory # G0812991915I4N00

Contact seller

Buy Used

US$ 7.28
Convert currency
Shipping: FREE
Within U.S.A.
Destination, rates & speeds

Quantity: 1 available

Add to basket

Stock Image

Gregory Brill
ISBN 10: 0812991915 ISBN 13: 9780812991918
Used Trade Paperback

Seller: Caspian Books, Tracy, CA, U.S.A.

Seller rating 4 out of 5 stars 4-star rating, Learn more about seller ratings

Trade Paperback. Condition: Good. Seller Inventory # 229152

Contact seller

Buy Used

US$ 5.00
Convert currency
Shipping: US$ 6.00
Within U.S.A.
Destination, rates & speeds

Quantity: 1 available

Add to basket