Hui Zhou zhouhui at wam.umd.edu
Wed Feb 2 07:27:16 PST 2005

On Wed, Feb 02, 2005 at 08:11:37AM -0700, Gerard Beekmans wrote:
>On Wed, 2005-02-02 at 07:32, Hui Zhou wrote:
>> I shouted several times that validation is unnecessary. Thanks for the 
>> example, I will explain.
>> 	After parsing, or during parsing, the tool will barf on 
>> missing source or destination under copy. He does not need a dtd to 
>> tell him, because without source or destination, he wouldn't know how 
>> to do it; even say, the dtd (faulty maybe) says its validate, the tool 
>> will barf because it doesn't make sense. 
>The tools exist to validate already. xmllint is an example. It takes any
>XML file with its DTD and tells you "copy is missing the required source
>and/or destination." We don't have to write the code for it, it already

We still need write the DTD and maintain that DTD. :)

>Yes it would take time to write a DTD. But it already exists. It won't
>take more time today to maintain the XML infrastructure that we already

The alfs team (NeoCool etc) have been talking about a complet new 
profile format with much more straight forward approach.

The old DTD, IMHO, brings more trouble than benefit. Do you enjoy 
writing 6 tags on "cp src dst"?

Actually, my point is the dtd validation is not really useful. A 
validated profile won't give you any (not a single bit) of confidence 
that the profile is problem free.
>> 	And for example, the tool takes defaults, the tool work 
>> happily with the copy on missing destination if a default destination 
>> available, there is nothing wrong there.
>> 	Missing destination under copy is not a very common mistake a 
>> profile writer will make, make typos in the destination is common. 
>> Validation won't help you here.
>You are right, it won't solve user error. But it will give a first clue
>of "something might be wrong here" to the user running the profiles. A
>warning could be shown "missing destination using default of xyz"
>telling the user that something might be wrong.

The tool can say the same thing on using any default. Someone likes a 
silient tool, some one don't. Make it an option, every one happy, in 
some degree.
>Again, validation of profiles isn't to catch typos and other building
>errors. It's just a first line of defense to point out potential issues.
>If you forget a close tag you should know about this before attempting
>to run a profile. 

Many html tags don't have close tags and work pretty well. A lot of 
html on the web don't conform to standard, and they work pretty well. 
It is difficult for the browser since they don't have control of 
millions of webmasters, but for alfs, it is trivia.

That first line of defense is useless and bring pure annoyances.

>It will either not work or very strange things happen
>if a close tag is expected and it never comes, or comes too late.

For general xml tool, yes, it is very difficult to parse the file if 
some closing tags are missing. 

For alfs, there is so limited nodes, it is trivia to detect that. Much 
easier than to cope with html.

>Validation is meant to make sure the profile is syntactical correct,
>typos in filenames are your own responsibility.

I am not saying the tool should catch typos. I am saying if the 
function(validation) won't help you much, why bother?

>It's the same with any compiler. It will tell you if your source code is
>syntactical correct but it won't attempt to fix your typos.

No, many compiler will try to fix some typos or syntax errors  on compiling. 
That is why you get 20 errors before the compiling stop, and that is why the 
compiler didn't stop on warnings.
>Maybe you can look at it this way: The profile is source code. The
>validation process is the compiler. Then it is accepted and now a proper
>executable piece of code.

I am looking at this way. No compiler uses external tool(such as 
indent) to validate the source before parsing.


Hui Zhou

More information about the alfs-discuss mailing list