[Typo3-dev] Make configuration simple

Elmar Hinz elmar.hinz at vcd-berlin.de
Mon Oct 17 10:29:28 CEST 2005


dan frost wrote:
> Unlikely - TypoScript has no structure (it has syntax) whereas a XML 
> with a good Schema / DTD does. Having a strong, check-able structure 
> makes in much, much easier to learn something and debug it.
> 

TypoScript has a syntax and a structure (differnt levels, etc.). What 
you mean is what Kasper calls semantic. In terms of XML and DTD this is 
  connected to the question of validation.


What does a DTD?

In short it gives an answer to the question: What language elements are 
allowed in the current context?

Editortools than can offer the appropriate elements like attributes, 
text and childenodes. Checkers can validate if everything is in the 
allowed places. (Still before validation is done syntax checkers test if 
the document is "well formed".)


Can validation be done for typoscript?

Yes it can be done, but it isn't such easy.

To validate a property you allways need to know in which context it is 
in. In example the property "value" has completly different datatypes in 
the context of the cObject HTML or in the if-function.

In XML each tag-name defines an unambiguous context on each level. So 
the context is easy to discover for validation. In typoscript we have 
cases where the configuration of a cObject or a function can even have 
sublevels and sublevels of sublevels.

If a validator allways has to first answer the question "Which context I 
am currently in?" that is much more difficult to answer in typoscript 
than in XML for this reasons. You can't simple take the property name. 
You need to use a combination of the parent context and the property 
name. (And for objects their name after the defining "=" .)

Then you can validate the value and subproperties if you have something 
at hand that compares a DTD. That is the second difficulty. It first 
needs to be designed. Secondly it needs to be learned by the 
programmers. Thirdly the validator has to be written, which requires an 
exellent programmer.


Couldn't typoscript be transformed to XML and than be validated?

I think by principle that could be done. But the information about the 
context that lacks in typoscript can't fall from heaven in XML. I expect 
that the DTD of the XML version would be so general for this reasons 
that it wouldn't have any use at all.


What is the right way?

Taking all this difficulties in account I see three possible ways:

1.) abandon the wish for validation and semantic and hold on typoscript

2.) give up typoscript for XML or something comparable that provides the 
necessary tools

3.) take up the efforts to make typoscript validatable


What do you think?



Regards

Elmar


























































-- 
Climate change 2005: Guatemala, New Orleans, Sahel, Bangladesh, Spain, 
Portugal, Austria, Swiss, France, ...
Production of CO2 is killing people.
Production of CO2 just for fun is killing people just for fun.




More information about the TYPO3-dev mailing list