}
}
//non lists:
- QString code="\t$p=$this->get"+prop+"();\n\tif($p!==null)";
+ QString code="\t$p=$this->get"+prop+"();\n";
//is it an attribute?
if(cls.propertyIsAttribute(prop))
- return code+"\t$root->setAttribute(\""+prop+"\",$this->getstr_"+prop+"());\n";
+ return code+"\tif($p!==null)$root->setAttribute(\""+prop+"\",$this->getstr_"+prop+"());\n";
//is it an element?
if(cls.propertyIsElement(prop))
- return code+"\t$root->appendChild($xml->createElement(\""+prop+"\",xq($this->getstr_"+prop+"())));\n";
+ return code+"\tif($p!==null)$root->appendChild($xml->createElement(\""+prop+"\",xq($this->getstr_"+prop+"())));\n";
//is it a class?
if(cls.propertyIsObject(prop))
- return code+"$root->appendChild($p->toXml($xml,\""+prop+"\"));\n";
+ return code+"\tif(is_a($p,\"WO"+cls.propertyPlainType(prop)+"\"))$root->appendChild($p->toXml($xml,\""+prop+"\"));\n";
//anything else?
qDebug("Warning: end of WocPHPServerOut::propertyToXml - this code should not be reachable.");
return "//internal generator error!\n";