Sign In/My Account | View Cart  
advertisement

Article:
 How Do I Hate Thee?
Subject: irrational hate
Date: 2004-11-15 01:48:30
From: jim fuller

I cant resist...though I will split into 2 categories; irrational and rational hatred....


top five irrational things I hate about XML, but wont fight too much;


1) ampersands...yes we need a few special characters but why could we not just state that an ampersand with whitespace around it is just an ampersand...I know, I know...


2) W3C XML Schema...I dont like its structure, I dont like its complexity...though I think this is more related to 'the right tool for the right scope'....W3C XML Schema says 'enterprise' to me...and along with SOAP and WS-* I would probably embark on using these 'heavy battleship' technologies and ML's when scope demanded it.


3) which leads to 'no simple schema or typing': is it so frightening to have


<somexml ss:type="integer"></somexml>


which says the value enclosed is an integer, string or whatever the top 5-10 types are?...w/o inheriting from W3C Schema..just a starting point...anything....along these lines why not an example XML document which implicitly defines a structure (e.g. yes exampletron).


4) linking/selection: what a missed opportunity, why did we not just inherit simple linking in XML ?


<x href="http://example.org/test.xml" >


with default behavior being a simple include...of course we could expand our definition....by adding xpath|xpointer|xquery


<x href="http://example.org/test.xml#xpointer(someelementtype)">


why not some xpath


<x href="http://example.org/test.xml#xpath(//someelementtype[@test='5'])">


....finally couldnt we use the effective XQuery syntax(sorry dont know compact form)whereby something like this


doc("auction.xml")//music:record[music:remark/@xml:lang = "de"]


turns into something like;

http://www.example.org/auction.xml#xquery({//music:record[music:remark/@
xml:lang=de]})


lets try a more advanced xquery linking/selection example;

{
let $doc := doc("prices.xml")
for $t in distinct-values($doc//book/title)
let $p := $doc//book[title = $t]/price
return
<minprice title="{ $t }">
<price>{ min($p) }</price>
</minprice>
}


ok I am hacking up syntax all over the place e.g. note use of curly brackets, not to mention that url encoding might complain but these are simple challenges.


http://wwww.example.com/prices.xml#xquery(<minprice><price>min(//book[ti
tle={distinct-values(//book/title)}]/price])</price></minprice>)


5) namespace distraction: I like namespaces...they are a simple method of avoiding name collision which is very useful if u are working at the nexus of many ML vocabularies...to me they are benign and do not cause any consternation other then the various processors which misinterpret the spec on their usage...though this is true of any technology.


I dont understand why a namespace cant link to a meta definition which contains all possible meta data which describes the xml.. whatever you may imagine....for example (for me) ...a mixture of namespace def ala NRL (namespace routing language), dublin core for authoring/versioning information and a bit of RDF..;


<namespace>
<rdf:Description xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" ID="date">
<dc:subject>XHTML</dc:subject>
<dc:subject></dc:subject>
<dc:subject></dc:subject>
<rdf:Description xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" ID="date.1">
<dc:creator>James Fuller</dc:creator>
<dc:date>2004-05-12</dc:date>
<dc:description>An extensible html superset blah blah blah</dc:description>
</rdf:Description>
</rdf:Description>
<rules xmlns="http://www.thaiopensource.com/validate/nrl">
<anyNamespace>
<validate schema="xhtml.rng"
useMode="#attach"/>
<validate schema="xhtml.sch"
useMode="#attach"/>
</anyNamespace>
</rules>


<!---put whatever you want here -->


</namespace>


though I could have added RDDL document...namespace should be a 'container'.. a dense rich multi-layered xml document which describes all aspects of an xml document....neat. One last pratical thing, namespaces make textual merging processes simple...such as encountered with most SCM's.


I will leave the rational things I hate for my own brooding!


Jim Fuller


Previous Message Previous Message   Next Message No Next Message


Sponsored By: