[Freeswitch-users] YAML support as an alternative of XML for configuration

Klaus Teller klaus.teller at gmx.net
Fri Jun 27 08:08:35 PDT 2008


I would think that it would be sufficient to provide parsers (or transformers) that allow people to translate FS artifacts from their favorite representations into XML (e.g. YAML to XML transaltor). 

Would that be a solution?

And, at then end of the day, the question will remain: how many people would absolutely need these alternate notations?

Klaus L'Imbecile.


-------- Original-Nachricht --------
> Datum: Fri, 27 Jun 2008 10:47:46 -0400
> Von: EdPimentl <edpimentl at gmail.com>
> An: freeswitch-users at lists.freeswitch.org
> Betreff: Re: [Freeswitch-users] YAML support as an alternative of XML for	configuration

> The debate of YAML vs XML and XML vs JSON is not new...
> Can YAML really replace  XML?
> To be frank, whatever can  be done in XML can be done without XML.
> Do you need XML for XML-RPC? Yes,
> Is it necessary to use XML for RPC? No.
> Is it necessary to use XML for RDF? No.
> Is it necessary to use XML for, anything? No.
> Is YAML a perfect replacement for XML? No
> Are there  circumstances, YAML may be more suitable than XML.
> http://www.ibm.com/developerworks/xml/library/x-matters23.html
> 
> YAML is designed with scripting languages (such as Python, Perl, PHP, and
> Ruby, among others) in mind.
> Using Python to parse YAML
> PyYAML is designed to be a Python parser.
> 
> <user id="MyPBX" on="localbox">
>         <firstname>John</firstname>
>         <lastname>QPublic</lastname>
>         <department>QA</department>
>         <cell>678-255-1185</cell>
>         <address password="xxxx">jqpublic at myaml.com</address>
>         <address password="xxxx">jqpublic at myxml.com</address>
>     </user>
> 
> Now, contrast this with what I would enter for the YAML file:
> 
>         MyPBX:
>             computer : localbox
>             firstname: John
>             lastname: QPublic
>             cell: 678-255-1185
>             addresses:
>                 - address: jqpublic at example1.com
>                   password: xxxxxxxx
>                 - address: jqpublic at example2.com
>                   password: xxxxxxxx
> 
> 
> Assuming we created a yaml document, and read the above  YAML structure
> into
> Python,  the resulting structure may look like:
> 
> {mypbx: {computer: localbox, firstname: John, lastname: QPublic, cell:
> 678,
> 255,1212, addresses: [{address: jqpublic at myaml.com, password:
> xxxxxxxx},{address: jqpublic at myxml.com, password: xxxxxxxx}]}
> 
> http://www.yaml.org/refcard.html
> http://yaml4r.sourceforge.net/cookbook/
> http://pyyaml.org/
> 
> So what about JSON then. is not JSON better than XML, YAML or OGDL?
> http://scripting.wordpress.com/2006/12/20/scripting-news-for-12202006/
> Briefly these do similar things in a different way.
> JSON works well with Javascript.
> YAML works without modification in Python and Ruby.
> XML works with almost every language having xml libraries.
> OGDL is similar to YAML and seems to now be adopted by JAVA
> http://ogdl.sourceforge.net/

-- 
GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
Jetzt dabei sein: http://www.shortview.de/wasistshortview.php?mc=sv_ext_mf@gmx




More information about the FreeSWITCH-users mailing list