473,507 Members | 12,693 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why is XML "stupid" about element ordering?

I'm not sure if this has been addressed in more recent developments, but I'm
reading the MathML specification which states "For example, it is not
possible in XML to specify that the first child be interpreted one way, and
the second in another." Is there a compelling reason that XML does not
support that capability? Has it been fixed?

I recall attempting to create my own schemas a couple years ago, and finding
this limitation. For my purposes it was significant.
--
..
Oct 30 '05 #1
5 1686
In article <mL********************@speakeasy.net>,
Arturius mac Aidan <ab*****@waters.loch> wrote:
I'm not sure if this has been addressed in more recent developments, but I'm
reading the MathML specification which states "For example, it is not
possible in XML to specify that the first child be interpreted one way, and
the second in another."
Since XML doesn't specify how elements are interpreted, this doesn't
make much sense. Applications can interpret XML any way they want to.
I recall attempting to create my own schemas a couple years ago, and finding
this limitation.


Now you are talking about schemas, which constrain XML and perhaps
assign types to it, rather than interpret it. It's true that you
can't use XML Schemas to specify different constraints on children of
an element with the same name, but there are all kinds of constraints
that you can't express.

-- Richard
Oct 30 '05 #2
Richard Tobin wrote:
In article <mL********************@speakeasy.net>,
Arturius mac Aidan <ab*****@waters.loch> wrote:
I'm not sure if this has been addressed in more recent developments, but
I'm reading the MathML specification which states "For example, it is not
possible in XML to specify that the first child be interpreted one way,
and the second in another."


Since XML doesn't specify how elements are interpreted, this doesn't
make much sense. Applications can interpret XML any way they want to.


I was quoting the W3C's MathML2 Recommendation. There are rules which
determine how a noun should be interpreted based on its location in a
sentence or phrase. Those are rules of grammar. I'm going to have to give
this more thought before I can provide a concrete example of what I had
expected to work. As I say, it's been a couple years, and I have not been
working with XML much in the interim. I do know I was frustrated by the
inability to constrain attributes according the the context of the element
where they appeared.
I recall attempting to create my own schemas a couple years ago, and
finding this limitation.


Now you are talking about schemas, which constrain XML and perhaps
assign types to it, rather than interpret it. It's true that you
can't use XML Schemas to specify different constraints on children of
an element with the same name, but there are all kinds of constraints
that you can't express.


This is taken directly from the XML 1.0, 3rd edition:

"Definition: The XML document type declaration contains or points to markup
declarations that provide a grammar for a class of documents. This grammar
is known as a document type definition, or DTD. The document type
declaration can point to an external subset (a special kind of external
entity) containing markup declarations, or can contain the markup
declarations directly in an internal subset, or can do both. The DTD for a
document consists of both subsets taken together."

I would argue that the use of DTDs is defined in the XML Recommendation.
That definition may leave some room for extension within the framework of
XML, but XML DTDs are not autonomous structures. The are required to
conform to several requirements stated by the XML Recommendation.
--
..
Oct 30 '05 #3
In article <s_********************@speakeasy.net>,
Arturius mac Aidan <ab*****@waters.loch> wrote:
I recall attempting to create my own schemas a couple years ago, and
finding this limitation.
Now you are talking about schemas, which constrain XML and perhaps
assign types to it, rather than interpret it. It's true that you
can't use XML Schemas to specify different constraints on children of
an element with the same name, but there are all kinds of constraints
that you can't express.
This is taken directly from the XML 1.0, 3rd edition:


Ok, I was taking schemas to mean XML Schemas, but the point is the
same: DTDs allow you to place constraints on a document; they don't
restrict how you can interpret the document. You are quite at liberty
to have the one <foo> element mean something quite different from
another.

-- Richard
Oct 30 '05 #4
Richard Tobin wrote:
In article <s_********************@speakeasy.net>,
Arturius mac Aidan <ab*****@waters.loch> wrote:
I recall attempting to create my own schemas a couple years ago, and
finding this limitation. Now you are talking about schemas, which constrain XML and perhaps
assign types to it, rather than interpret it. It's true that you
can't use XML Schemas to specify different constraints on children of
an element with the same name, but there are all kinds of constraints
that you can't express.
This is taken directly from the XML 1.0, 3rd edition:


Ok, I was taking schemas to mean XML Schemas,


Had I not looked at the XML Recommendation for clarification, I would not
take issue with your drawing a distinction; however, in view of the useage
by the W3C, I believe "DTD" is intended to be inclusive of all XML grammar
definitions. That is, XSD definitions are DTDs in the sense that they
define a document type.
but the point is the
same: DTDs allow you to place constraints on a document; they don't
restrict how you can interpret the document. You are quite at liberty
to have the one <foo> element mean something quite different from
another.


Yes, but sometimes syntax and semantics are interrelated. I am not able to
dedicate the time to formulating a compelling example right now. I have
literally thousands of pages of technical material to cover in a short
period. I can offer the example of natural languages, and in particular,
the grammatically degenerate English language which relies heavily on
syntax to convey semantic interpretations. In an English sentence, the set
of words (and word-forms) which are permitted to immediately follow a noun
is determined by the role that noun plays in a sentence. So, for example,
if I have element definitions for parts of speech such as <noun/> <verb/>
<adverb/>, etc., the list of permissible tags allowed by the rules of
English grammar is determined by what precedes it in a sentence.

I do not believe XML DTDs (inclusive) are capable of codifying English
grammar in this sense. I'm not saying they should be. That's why I
suggested the example given is less than compelling.

--
..
Oct 31 '05 #5
Arturius mac Aidan wrote:
Richard Tobin wrote:
In article <mL********************@speakeasy.net>,
Arturius mac Aidan <ab*****@waters.loch> wrote:
I'm not sure if this has been addressed in more recent developments,
but I'm reading the MathML specification which states "For example,
it is not possible in XML to specify that the first child be
interpreted one way, and the second in another."


Since XML doesn't specify how elements are interpreted, this doesn't
make much sense. Applications can interpret XML any way they want
to.


I was quoting the W3C's MathML2 Recommendation. There are rules which
determine how a noun should be interpreted based on its location in a
sentence or phrase. Those are rules of grammar. I'm going to have to
give this more thought before I can provide a concrete example of what
I had expected to work.


That would be useful, as I find it hard to imagine what you expect.
Are you implying that in the sentence

<para><productname>Word</productname> is like
<productname>WordPerfect</productname>.</para>

the first productname element should be treated differently to the
second?

///Peter
--
XML FAQ: http://xml.silmaril.ie/

Oct 31 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
2106
by: Jordan Rastrick | last post by:
First, a disclaimer. I am a second year Maths and Computer Science undergraduate, and this is my first time ever on Usenet (I guess I'm part of the http generation). On top of that, I have been...
17
7236
by: Torbjørn Pettersen | last post by:
I've got a table where I want some of the cells to use a background image. The cells have variable height, so I am using an image with a rather small height to fill up the background of the cells,...
32
3348
by: Will Hartung | last post by:
Can someone clarify that multiple classes in the "class" attribute are ok and "legal" and not some fluke? So, I can do: ..pink {color: pink} ..bold {font-weight: bold} ..medium {font-size:...
388
21407
by: maniac | last post by:
Hey guys, I'm new here, just a simple question. I'm learning to Program in C, and I was recommended a book called, "Mastering C Pointers", just asking if any of you have read it, and if it's...
7
8092
by: Lenn | last post by:
This probably something stupid, or I am missing some fundemantal concept, but I can't figure this one out. Consider the following code: byte bd = new byte; bd = 0x00; bd = 0x01; ...
6
1597
by: Adam Smith | last post by:
I have posted this and similar questions repeatedly and can't even raise a single response. I am being led to believe that this then 'Must be a stupid question' although people say that there is no...
9
10695
by: Klaus Johannes Rusch | last post by:
IE7 returns "unknown" instead of "undefined" when querying the type of an unknown property of an object, for example document.write(typeof window.missingproperty); Has "unknown" been defined...
4
23829
by: tswaters | last post by:
Alright, so generally I'm using document.createElement("IMG").... but, I've noticed something just recently that made me switch to "new Image()" What I'm doing is creating a photo gallery of...
19
2182
by: maya | last post by:
hi, so what is "modern" javascript?? the same as "DOM-scripting"? i.e., editing content (or changing appearance of content) dynamically by massaging javascript objects, html elements, etc? ...
0
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7372
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7030
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7482
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5623
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
758
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.