Lists Home |
Date Index |
>> 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.
Questions like this are asked *today* in an XML certification exam like IBM
> 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.
This is why I am worried about this exam: on many occasions I found out that
the question's text did not provide enough information. In such situations you
just have to try to guess what the exam writer was thinking and as a result you
are guessing the answer too.
>> 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)" and "(//partNumber)" 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.
I will try to clarify the question. The answer from this quiz suggests that
flexibility can only be achieved by using mixed content models. Should I just
discard this (as Michael Kay suggested) or there is some true behind this
>> Can somebody give me an example of an XML document that is *not*
>> 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.
You can achieve this with mixed content models. With this you can add as many
elements as you want where you want.
> 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.
I did not read about XQuery yet. "Fragments", "XQuery" and "XLink" are my
targets for the next week. I just want to say that if your "p" is found in the
same XML instance then it must be in different namespaces otherwise the
document would be invalid. Since they are in different namespaces it seems
logical that there is a way to differentiate between them using their
namespaces. I will not comment on this any further because I still have to read
about XQuery. After that, maybe, your words will have a new meaning to me.
> 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.
In seems that Relax NG is very popular in certain circles. However the
author of "Professional XML" states that Relax NG is not meant to replace XML
"All of these proposals might be seen as providing lighter-weight alternatives
to an implementation using XML Schemas. None of them (except perhaps DSD) are
intended to replace XML Schema since it has many capabilities that are not
present in these other proposals."
The author was speaking about DSD (Document Structure Description), RELAX
(Regular Language for XML), TREX (Tree Regular Expressions for XML) and
> 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
You are basically saying that there are no special design decisions to make
when you want to design a "flexible and open to future changes" XML document.
A second thought: the vocabulary may not be important but the way you
declare the relationships between elements could impact the future
extensibility of your documents. I will think about this.