Re: Re: extending the mdb schema format

From: Date: Tue, 14 Jun 2005 17:40:51 +0000
Subject: Re: Re: extending the mdb schema format
References: 1 2 3 4  Groups: php.pear.dev php.pear.dev 
Request: Send a blank email to pear-dev+get-38126@lists.php.net to get a copy of this message
Hello, on 06/14/2005 01:25 PM Lukas Smith said the following:
Just wondering what the dislike of attributes is all about? I would have tended to use attributes for single value items, and child tags for nesting/multivalue data.. or is it just easier to parse??
Well Manuel designed the original format and didnt use any attributes mainly because he didnt want to rely on any php internal xml parser which were flaky or non existant back when he wrote things. So he wanted to keep the parser simple.
Actually that is not the reason. Metabase uses a XML parser class based on the Expat extension that is there since PHP 3 and probably remain in PHP forever. The reason to use tag data instead of attributes is because attributes contradict the meaning of X in XML: eXtensible. This means you can't use tags in attribute values. For instance you can't do this: <field default="<variable>some_external_value</variable>" /> but you can do this: <field> <default><variable>some_external_value</variable></default> </field> This is extremelly important because it lets you customize applications installation with values in the schema defined only at installation time. -- Regards, Manuel Lemos PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/ Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html

« previous php.pear.dev (#38126) next »