Altova Mailing List Archives


Re: [xml-dev] malfunctioning, evil adult as XML

From: Elliotte Rusty Harold <elharo@-------.---.--->
To: "Emmanuil Batsis (Manos)" <mbatsis@--------.-->,xml-dev <xml-dev@-----.---.--->
Date: 2/1/2003 12:33:00 PM
At 12:17 AM +0200 2/1/03, Emmanuil Batsis (Manos) wrote:

>I don't see how XML can get violated by what I suggested. In the 
>case you imply where the XML is for consumption by multiple 
>entities, there must be some agreement in the form of a schema 
>anyway. What I suggest is a flexible model that does not break XML 
>1.0 and can be agreed upon. No reason to worry... just expect a 
>simple type in the form of either an element or an attribute; but a 
>simple type is just that.

A transform from one XML vocabulary to another is fine, as long as 
it's clear that's what you're doing. However, the problem is that 
this promulgates the idea that attributes are just a funny kind of 
child element, and they're not. The structure of the document is not 
the same before and after the transformation.  They have 
characteristics child elements don't have and vice versa. They are 
not equivalent. Changing attributes to child elements or vice versa 
is not the same thing as changing double quotes to single quotes 
around attribute values or adding extra white space inside tags. This 
is not just a matter of syntax sugar.  Developers who think they are 
the same are going to encounter problems, probably sooner rather than 
later.

Oh, and one more thing: there does not need to be any agreement about 
anything, including the schema. Well-formedness is all that's 
required. There are no types. There's just elements. And elements can 
have substructure, even when the schema says they can't. Such a 
document would schema-invalid, but is still completely legal and can 
be usefully processed.
-- 

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo@m... | Writer/Programmer |
+-----------------------+------------------------+-------------------+
|           Processing XML with Java (Addison-Wesley, 2002)          |
|              http://www.cafeconleche.org/books/xmljava             |
| http://www.amazon.com/exec/obidos/ISBN%3D0201771861/cafeaulaitA  |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:  http://www.cafeaulait.org/      |
|  Read Cafe con Leche for XML News: http://www.cafeconleche.org/    |
+----------------------------------+---------------------------------+

Disclaimer

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.