[Typo3-dev] Validating TypoScript - Schema vs. DTD
dan frost
dan at danfrost.co.uk
Tue Nov 29 23:42:33 CET 2005
Hi everybody!
Here goes... I've spent ages looking at
TypoScript, its implementation and architecture
and alternatives. The following is my opinion...
and (PLEASE READ THIS) i am not attacking anyone
in-particular... I am making points which i think
are assumed and important to realise about the
whole TS issue.
1. I suggest that TypoScript as-is should not have
more validation effort invested in it. A more
object based model would justify such a thing
2. Remeber: TypoScript is (or was) meant to be
configuation language - therefore a simple DTD
would make sense for it
2a. But: the DTD (or whatever) should be
extendable - i must be able to add
MY_NEW_MENU_TYPE in the future and .my_silly_function
3. I have often suggested as twin approach to TS /
XML - write in TS, but store (and describe) in
XML. Therefore, you win the detail of XML (+
validation) and the easy of typing of TS.
4. In my opinion - and I *know* this is argued
against - there is more worth in spending time of
defining what TS should be and rebuilding it than
in trying to build tools around it as is. (Please
don't argue about my point of view - argue about
the detail...)
5. Debugging TS *is* complicated and slow - anyone
who says otherwise hasn't used profession
development tools with break-points, full logging,
object-tracking etc... or they have and can't
imagine them in TS! ... my point: TS should be the
fastest thing to debug: it must be tool, not a burden.
6. The whole "for the beginner" argument, where
the beginner has to spend ages learning TS does
not hold water: software is only as useful as the
time it saves. If it takes 6 months to learn TS,
and over 1000 developers are using it that meants
that 500 developer-years have been spent learning
it. IF this can be reduced, it should - the
difficulty of a language is NOT a measure of its
usefulness. Often, the opposite.
7. I think TS is a great model for the future of
web development - small objects, small tools
giving great power.
Now:
Do not argue. Do develop.
dan
Elmar Hinz wrote:
> Hello,
>
> a month ago we had a discussion about the future of TypoScript. We came
> to the point that it is important to validate it. Without validation we
> get less error messages about wrong compositions. That slowes down
> production. This slowdown is compensed by a very short form of notation
> in comparism to XML. But we don't feel really lucky without the
> possibility of validation. A lot of TYPO3 users would prefer XML.
>
> Validation is an important point. But the discussion came to no real
> result if validation of TypoScript could be possible. I guess the reason
> for this is that only few of us really know how validation works.
>
> I currently make some thoughts about converting TS to XML and to
> validate that.
>
>
> page = PAGE
> page.10 = HTML
> page.10.value = Test
> page.10.if.value = 1
> page.10.if.equals = 2
> page.20 = COA
> page.20.10 = HTML
> page.20.10.value = Test
>
> ...
>
> <page type="PAGE">
> <10 type="HTML">
> <value>Test</value>
> <if>
> <value>2</value>
> <equals>1</equals>
> </if>
> </10>
> <20 type="COA">
> <10 type="HTML">
> <value>Test</value>
> </10>
> </20>
> </page>
>
> I don't know if numbers are valid XML Elements. But one could write
> <number10> instead of <10>. That isn't the point.
>
> I see a problem with ambiguus elements like "value" or "number10".
> Depending on their context they are of different Types. That means that
> depending on their own parents different childs are allowed.
>
> My knowladge about DTD tells my, that is not possible to define
> different childs for an element depending on the parent context.
>
> Does anybody know if schema do offer something like this?
>
> Regards
>
> Elmar
>
>
>
>
>
>
>
More information about the TYPO3-dev
mailing list