OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] Quiz: XML flexibility

[ Lists Home | Date Index | Thread Index ]

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@CraneSoftwrights.com
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





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS