Empty tags created for integer = 0 #14

Closed
maciejmajewski opened this Issue Aug 23, 2012 · 0 comments

2 participants

@maciejmajewski

Regression bug caused by issue #11.

Given:

$plist = new CFPropertyList();
$dict = new CFDictionary();

$dict->add('string', new CFString(''));
$dict->add('number', new CFNumber(0));
$dict->add('double', new CFNumber(0.0));

$plist->add($dict);

print $plist->toXML();

Current:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"><dict><key>string</key><string/><key>number</key><integer/><key>double</key><real/></dict></plist>

Expected:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"><dict><key>string</key><string/><key>number</key><integer>0</integer><key>double</key><real>0</real></dict></plist>

Actual implementation creates empty tags also for integer and real elements.

@ckruse ckruse closed this in 321b13f Aug 27, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment