Whitespace Considerations

Steve Muench, author of the soon-to-be-released "Building Oracle XML Applications" to be published by O'Reilly & Associates, Inc. (http://www.oreilly.com/) provides us with a tip concerning WS nodes.

  -Brent Sheets, Site Editor

-------------------------------------------------

Remember that an XML document can look like this:

  <ROWSET>
    <ROW num="1">
      <X>Y</X>
    </ROW>
  </ROWSET>

or it can look like this:

  <ROWSET><ROW num="1"><X>Y</X></ROW></ROWSET>

NOTE: While both expressions contain a logically equivalent element structure, the former example contains additional whitespace to give it that indented look. Specifically, it contains a carriage return at the end of every line followed by a series of spaces at the start of the next line. When considering an XML document as a tree of nodes, don't forget that the text nodes containing whitespace also count as nodes the same as text like 7788 or SCOTT. Since you can't see it, whitespace is easy to forget about.

-------------------------------------------------

Read a sample beta chapter from "Building Oracle XML Applications" by Steve Muench, by visiting O'Reilly & Associates, here ( http://www.ora.com/catalog/orxmlapp/)

Steve Muench is Oracle's lead XML Technical Evangelist and development lead for Oracle XSQL Pages. He is Oracle's primary representative to the W3C XSL Working Group, as well as a consulting product manager and developer working on Oracle Business Components for Java--an XML-based business object framework. In his more than ten years at Oracle, Steve's been involved in the support, development, and technical evangelism of Oracle's application development tools and database, and is a frequent presenter at both Oracle and XML technical conferences.

This was first published in September 2000

Dig deeper on XML and XML schema

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchSoftwareQuality

SearchCloudApplications

SearchAWS

TheServerSide

SearchWinDevelopment

Close