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

Dimitri Tarassenko mitka at mitka.us
Tue Nov 29 19:13:26 CET 2005


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?).

--
Dimitri Tarassenko


More information about the TYPO3-dev mailing list