[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: The triples datamodel -- was Re: SemanticWeb per


RE:  The triples datamodel -- was Re:  SemanticWeb per
At 10:21 AM -0700 6/4/04, Howard Katz wrote:
>I don't understand this last point, Elliotte. How can a properly designed
>application ask whether a document contains the information it needs without
>knowing about the document's structure? If you add information, you're most
>likely changing the structure, and consequently the schema. How can an
>application cope with ad hoc changes like that w/out looking at the schema,
>ie without doing validation?

Let me answer with an example. Suppose you want to extract today's 
news from Cafe con Leche, an invalid XHTML document. The following 
XPath will do it:

//html:today

(assuming the html prefix has been bound to the XHTML namespace in 
whatever environment you're using). You need to know nothing else 
about what surrounds the today element, where it's positioned in the 
document, or even how many today elements there are. You don't care 
what the today elements contain. You don't care what contains them. 
It is a very robust solution, much more so than solutions based on 
explicit knowledge that the today element is the seventh child of a 
td element that is is the first child of a tr element that is the 
first child of a table element that is a child of the only table 
element that is the second child of a body element that is the only 
body child of an html element which is the root element of the 
document.

At no point do you need to know the scheme for the page in order to 
extract information from it. Indeed if you tried to do that, you'd 
fail because the page is invalid and the relevant information is 
found in elements that don't even exist in the schema.
-- 

   Elliotte Rusty Harold
   elharo@m...
   Effective XML (Addison-Wesley, 2003)
   http://www.cafeconleche.org/books/effectivexml
   http://www.amazon.com/exec/obidos/ISBN%3D0321150406/ref%3Dnosim/cafeaulaitA

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.