out << " edition-old=\"" << rold->edition() << "\"";
out << " arch-old=\"" << rold->arch() << "\"";
}
- if (!res->summary().empty())
- out << " summary=\"" << xml::escape(res->summary()) << "\"";
- if (!res->description().empty())
- out << ">" << endl << xml::escape(res->description()) << "</solvable>" << endl;
- else
- out << "/>" << endl;
+ {
+ const std::string & text( res->summary() );
+ if ( !text.empty() )
+ out << " summary=\"" << xml::escape(text) << "\"";
+ }
+ {
+ const std::string & text( res->description() );
+ if ( !text.empty())
+ out << ">\n" << "<description>" << xml::escape( text ) << "</description>" << "</solvable>" << endl;
+ else
+ out << "/>" << endl;
+ }
}
}
}
ret << " edition=\"" << val_r->edition() << "\"";
ret << " arch=\"" << val_r->arch() << "\"";
{
- std::string text( val_r->summary() );
+ const std::string & text( val_r->summary() );
if ( ! text.empty() )
ret << " summary=\"" << xml::escape( text ) << "\"";
}
- { // legacy: description as solvable:PCDATA instead of a subnode
- std::string text( val_r->description() );
+ {
+ const std::string & text( val_r->description() );
if ( ! text.empty() )
- ret << ">\n" << xml::escape( text ) << "</solvable>";
+ ret << ">\n" << "<description>" << xml::escape( text ) << "</description>" << "</solvable>";
else
ret << "/>";
}
" isbase=\"" << (p.isTargetDistribution() ? 1 : 0) << "\""
" repo=\"" << xml::escape(p.repoInfo().alias()) << "\""
" installed=\"" << (is_installed ? 1 : 0) << "\"";
- if (p.description().empty())
- str << "/>";
- else
- str
- << ">" << endl << "<description>" << p.description() << "</description>"
- << endl << "</product>";
+ {
+ const std::string & text( p.description() );
+ if ( text.empty() )
+ str << "/>";
+ else
+ str
+ << ">\n" << "<description>" << xml::escape( text ) << "</description>"
+ << endl << "</product>";
+ }
return str.str();
}
" repo=\"" << xml::escape(p.repoInfo().alias()) << "\""
" installed=\"" << (is_installed ? 1 : 0) << "\""
" uservisible=\"" << (p.userVisible() ? 1 : 0) << "\"";
- if (p.description().empty())
- str << "/>";
- else
- str
- << ">" << endl << "<description>" << p.description() << "</description>"
- << endl << "</pattern>";
+ {
+ const std::string & text( p.description() );
+ if ( text.empty() )
+ str << "/>";
+ else
+ str
+ << ">\n" << "<description>" << xml::escape( text ) << "</description>"
+ << endl << "</pattern>";
+ }
return str.str();
}