[Typo3-dev] Validating TypoScript - Schema vs. DTD

Elmar Hinz elmar.DOT.hinz at team.MINUS.red.DOT.net
Wed Nov 30 23:14:01 CET 2005


Christian Welzel wrote:

> The problem is that TS is very flexible and extensible. Think 
> only of the many config-options introduced by extentions... 
> how do you want to update the schema or dtd to reflect this 
> new options ?
> 

True. Validating extension could only be done, if extensions provide 
calculatable information about their config-options. Otherwise they need 
to be excluded from validation. That is the case for any validation 
technic, not only schema.


> I think the best approach to validate TS is to write a tree
> traversal validator using simple php objects. The syntax is
> already checked by the parser while transforming the TS into
> the php-Array. So all the validator has to do is to make sure,
> all options are existing in the current TS-object.

That's a good point. Why using XML and DTD, if we allready have an array 
to traverse?

But building one validation object for every TS object looks like a lot 
of work. To much work only for the purpuse of validation. That would 
come closely to Dans TS objects project and efforts would better be 
invested in a common project of that type.

But it brings me to a new idea. Why not using only one object, that 
fetches it's informations about valid child properties simply from a table.

This table allready exists. It's name is TSref.

Surly some work would need to be invested, to make it usable for 
automated validation. But that would be lesser work then writing a large 
DTD or code lots of validation objects. As side effect TSref would get 
some overwork and controlling.

Extensions could provide validation tables in the appropriate format. 
They already do something that comes near to this, if documentation is 
complete.

The proof of concept shouldn't be to difficult. Hm, I have got the 
feeling that this could be realistc.

Maybe I make this "my" next contributional project. With validation I 
think TS a future proof configuration language, maybe the best one.

Thanks for hinting me to this.

Elmar


-- 
Climate change 2005: Mexico, 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