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

Re: Quiz: XML flexibility


what is flexibility
At 2005-02-27 21:59 +0200, Razvan MIHAIU wrote:
>         In an XML quiz I found the following question:
>...
>         Isn't this a dumb question ?

I remember when questions like this came up for certification exams and 
boot camps in the "early days" of XML.  I swear the boot camp coached the 
attendees to come up with the particular answers for the particular 
certification exams.

I was asked to comment on some such questions ... I never liked the 
questions and I could often come up with two vastly different answers to a 
given question, or find real-world situations in my experience that could 
match more than one answer of a multiple-guess type of question.

>What I am really trying to understand is "what is flexibility" ? In any XML
>document you can ...

...do anything you want that meets the business requirements and technical 
requirements of the application.  People who answer such questions are 
going to give answers based on their experiences with XML.  People who ask 
such questions are expecting answers based on their own experiences with XML.

Who is to say which is "right"?

To me, an unambiguous XML question is "compare the cardinality of each of 
the two XPath expressions "(//partNumber)[1]" and "(//partNumber[1])" and 
explain the mechanics behind your conclusions".  No "real-world experience 
influence" there and someone who knows XPath knows when to use which one where.

>         Can somebody give me an example of an XML document that is *not* 
> flexible as
>opposed to one that it is ?

Document models described by W3C Schema are extensible only adding new 
constructs to the end of content models of existing constructs ... to me 
this is not very flexible at all ... I might want to put new information in 
the middle of a content model.

Document models described by RELAX-NG are extensible merely by producing 
the union of *any* two other document models ... to me this is *very* 
flexible.  I can accommodate old and new instances of any vocabulary in 
this simple fashion by creating the new union vocabulary.

Running a query on a document modeled by W3C Schema can produce an instance 
result that cannot be modeled by W3C Schema mechanically by a machine 
analysis of the schema expression.  Consider a document where the element 
"p" is modelled one way in one context using a given type, and modelled 
another way in another context using a different type, and the query 
returns an instance of all "p" elements ... since sibling "p" elements in 
W3C Schema cannot have different content models, I cannot machine-generate 
a W3C Schema expression of the model of this result, and I'm obliged to do 
so by hand without the benefit of co-occurrence constraints to help.  To me 
this is not very flexible.

Running a query on a document modeled by RELAX-NG can produce an instance 
result that is easily modelled mechanically by simply expressing the union 
of the content models of all possible results.  To me this is *very* flexible.

So, to me, these are the kinds of questions to ask to deduce the nature of 
"what is flexible XML?" ... not anyone's particular choice of a given 
vocabulary.

I hope you find this helpful.

...................... Ken


--
World-wide on-site corporate, govt. & user group XML/XSL training.
G. Ken Holman                 mailto:gkholman@C...
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/x/
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
Male Breast Cancer Awareness  http://www.CraneSoftwrights.com/x/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal


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.