* Lukas Ocilka <lukas.ocilka@suse.cz> [Jul 04. 2007 11:59]:
Klaus Kaempf wrote:
As part of hackweek project http://idea.opensuse.org/content/ideas/ycp-to-ruby-translator I just committed changeset #39159 to yast-core on svn trunk.
This changeset adds toXml() methods to all YCP and YCode classes, giving all ycp code and data structures a representation as XML.
Klaus, does it also support toYCP :)? See the attached file.
During the HackWeek I met with Benji and we've decided to use his XML format for 'some other' Installation/Repository handling. It would be nice to have both toXml and toYCP.
I fail to see the relation between a metapackage/repository description and YCP. The toXml() code 'just' converts, i.e. { integer i = 0; repeat { i = i + 1; if( i < 5 ) continue; break; } until( i > 10 ); return i == 5; } to <?xml version="1.0" encoding="UTF-8"?> <ycp> <block kind="file"> <symbols> <entry global category="filename" type="<unspec>">../../../libycp/testsuite/tests/statements/Repeat-Until-Continue.ycp</entry> <entry category="variable" type="integer">i</entry> </symbols> <point>000</point> <statements> <assign><entry>i</entry><expr><const><int>0</int></const></expr></assign> <repeat> <do> <block kind="unspec"> <point>000</point> <statements> <assign><entry>i</entry><expr><yebinary><static name="+"><type kind="integer (integer, integer)"/></static><entry>i</entry><const><int>1</int></const></yebinary></expr></assign> <if><compare op="<"><entry>i</entry><const><int>5</int></const></compare><then><continue/></then></if> <break/> </statements> </block> </do> <until><compare op=">"><entry>i</entry><const><int>10</int></const></compare></until> </repeat> <return><compare op="=="><entry>i</entry><const><int>5</int></const></compare></return> </statements> </block> </ycp> Klaus --- SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org