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

Ries van Twisk typo3 at rvt.dds.nl
Tue Nov 29 20:55:22 CET 2005


Dimitri Tarassenko wrote:

>Elmar,
>
>On 11/29/05, Elmar Hinz <elmar.DOT.hinz at team.minus.red.dot.net> wrote:
>
>  
>
>>My knowladge about DTD tells my, that is not possible to define
>>different childs for an element depending on the parent context.
>>    
>>
>
>How about doing it in a slightly different way:
>
><page name="page">
>    <html name="10">
>         <value>Test</value>
>         <if><value>2></value><equals>1</equals></if>
>    </html>
>    <coa name="20">
>          <html name="10"><value>test2</value></html>
>    </coa>
></page>
>
>In outher words, a typoscript object type would corellate to XML
>element type, and the identifier will be stored in "name" or any other
>attribute.
>
>The bigger problem, is, however, "stray" definitions, where you, say,
>misspell "config" or some other config variable, and, while it will be
>perfectly normal TypoScript it will not produce the results you want.
>
>If you are validating the syntax only I would say XML->DTD validation
>is not the way to go. I don't think you can enforce some of TypoScript
>syntax rules through DTD (for example, multi-line values in ( ) ).
>
>I would probably look at other syntax parsers available (bison, lexx?).
>
>  
>
I think XML can be a storage format for TS, but not the right way to 
create TS.
TS as cryptic is it is right now should not be written in XML like shown 
above,
it greatly reduces readability... unless we create a XML editor in typo3 
to create TS..

I think a good way would be using OBTS (never used it yet but always 
wanted to) and using a
syntax parser as suggested above.

just my 2 cents.

Ries




More information about the TYPO3-dev mailing list