<< C++0x Rejects Concepts Proposal | Home | Friday Algebra Quiz: Find The Roots >>

No Language Is Simple That Begins With...

... something like the following:

<?xml version="1.0" encoding="UTF-8"?>
<blah xmlns="http://www.blahblahframework.org/schema/blahblahblah"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.blahblahframework.org/schema/blahblahblah
                          http://www.blahblahframework.org/schema/blahblah/blahblah-blahblahblah-2.0.xsd">
  <!-- YOUR CODE HERE -->
</blah>
Tags :


Re: No Language Is Simple That Begins With...

I completely agree. Nothing more to say.

Re: No Language Is Simple That Begins With...

Amen.

Re: No Language Is Simple That Begins With...

... another reason why JSF sucks !

Re: No Language Is Simple That Begins With...

Why? Can't you just memorize it?

Re: No Language Is Simple That Begins With...

Or better yet, make a boilerplate.

Re: No Language Is Simple That Begins With...

What of: <?validator RNGSchema="org.blahblah.blah blah.rng" type="xml"?> <blah xmlns="org.blahblah.blah"> <!-- Your code here --> </blah> I've never felt comfortable binding validation information to an instance node when it should properly be in a header. I also think that moving from URI-type namespaces to Java type can do a lot to simplify the apparent complexity of XML files. Other than those caveats, I'm not really sure that this is different from any other type of namespace binding - perhaps a little more terse and cryptic than some, but certainly understandable.

Re: No Language Is Simple That Begins With...

As soon as an XML document enters into the realm of "this document is expected to be processed with my little program on http://blahblahframework.org, and no program else," the attached schema information become superfluous and pure baggage. The little program on http://blahblahframework.org surely knows where the schema is, right?

Re: No Language Is Simple That Begins With...

Okay, I'll admit, I'm trying to play devil's advocate here. A language such as Java has a well defined processing model - I know that if I write an application with Java, then I will at some point call javac on the source code in order to compile it or java on the compiled code to run it - this is implicit in the data model. XML has no such surety, because there are no clearly defined processing operations on an XML language - it is, by definition, a metalanguage. An XML instance may have one or more processing models because the language that the XML represents does have processing semantics, but the XML itself has none. What that means in practice is that yes, the XML is going to be more cumbersome. Now, should validation processing be a an attribute on the XML instance itself? No, that's always bothered me - that's the role of PIs, and frankly that's one of the few reasons I can think of for keeping PIs in the first place. However, XML is complex because it is a meta-language or abstraction language. The cost of working with that abstraction is a bit more complexity in the processing than would be required in cases where the processing model itself is inherent within the language itself. I hope I'm reading your comments correctly in that regard.

Re: No Language Is Simple That Begins With...

I think we understand each others point perfectly well. I sympathize with your "the schema should not be an attribute on an instance, it should be a processing instruction" stand.

My gripe is more along the lines "the XML editor/IDE and the actual program that processes the instance should be able to infer the schema in the scenario at hand."

There are more situations where XML makes who creates the document do extra work, e.g., the mandatory end tag, quotes around attributes, etc., things even HTML allows. All small things, but they adds up to build frustrations for the user who actually has to hand write the XML document.

I'm more and more of the opinion that if a language designer doesn't think about the programmer enough to create a usable language with a custom syntax, then the users probably should rebel against such a language and go for the more considerate language designer.

XML based languages are losers in the long run.


Add a comment Send a TrackBack