![]() |
Форум больше не используется. Присоединяйтесь к каналу #community-ru в Slack for TYPO3 community |
|
![]() |
#1 |
Продвинутый
Регистрация: 08.04.2005
Сообщений: 35
|
![]()
Михаил, а Вы ничего про TSML не слышали? =)
так, краем уха.. =))) |
![]() |
![]() |
![]() |
#2 |
Новенький
Регистрация: 28.04.2005
Сообщений: 12
|
![]()
to: Maestro
Нет ничего, просветите меня... |
![]() |
![]() |
![]() |
#3 |
Administrator
|
![]()
Why not XML instead?
A few times TypoScript has been compared with XML since both \"languages\" are frameworks for storing information. Apart from XML being a W3C standard (and TypoScript still not... :-) the main difference is that XML is great for large amounts of information with a high degree of \"precision\" while TypoScript is great for small amounts of \"adhoc\" information - like configuration values normally are. Actually a data structure defined in TypoScript could also have been modeled in XML. Currently you cannot use XML as an alternative to TypoScript (writing of June 2003) but this may happen at some point. Lets present this fictitious example of how a TypoScript structure could also have been implemented in \"TSML\" (our fictitious name for the non-existing TypoScript-Mark Up Language): styles.content.bulletlist = TEXT styles.content.bulletlist { current = 1 trim = 1 if.isTrue.current = 1 # Copying the object \"styles.content.parseFunc\" to this position parseFunc < styles.content.parseFunc split { token.char = 10 cObjNum = 1 1.current < .cObjNum 1.wrap = <li> } # Setting wrapping value: fontTag = <ol type=\"1\"> | </ol> textStyle.altWrap = {$styles.content.bulletlist.altWrap} } That was 17 lines of TypoScript code and converting this information into an XML structure could look like this: <TSML syntax=\"3\"> <styles> <content> <bulletlist> TEXT <current>1</current> <trim>1</trim> <if> <isTrue> <current>1</current> </isTrue> </if> <!-- Copying the object \"styles.content.parseFunc\" to this position --> <parseFunc copy=\"styles.content.parseFunc\"/> <split> <token> <char>10</char> </token> <cObjNum>1</cObjNum> <num:1> <current>1</current> <wrap><li></wrap> </num:1> </split> <!-- Setting wrapping value: --> <fontTag><ol type="1"> | </ol></fontTag> <textStyle> <altWrap>{$styles.content.bulletlist.altWrap}</altWrap> </textStyle> </bulletlist> </content> </styles> </TSML> That was 33 lines of XML - the double amount of lines! And in bytes probably also much bigger. This example clearly demonstrates why not XML! XML will just get in the way, it is not handy for what TypoScript normally does. But hopefully you can at least use this example in your understand of what TypoScript is compared to XML. The reasonable application for using XML as an alternative to TypoScript is if an XML editor existed which in some way makes the entering of XML data into a structure like this possible and easy. |
![]() |
![]() |
![]() |
#4 |
Administrator
|
![]()
http://typo3.org/documentation/document-library/doc_core_ts/Myths_FAQ_and_Ackno/
|
![]() |
![]() |