1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-22 20:12:07 +01:00

Make Bookmarks.toXML() return valid XML again

Fixes SMACK-594
This commit is contained in:
Florian Schmaus 2014-08-14 22:25:52 +02:00
parent 3c88c2f705
commit 450015bf40

View file

@ -169,13 +169,13 @@ public class Bookmarks implements PrivateData {
@Override @Override
public XmlStringBuilder toXML() { public XmlStringBuilder toXML() {
XmlStringBuilder buf = new XmlStringBuilder(); XmlStringBuilder buf = new XmlStringBuilder();
buf.openElement(ELEMENT).xmlnsAttribute(NAMESPACE); buf.halfOpenElement(ELEMENT).xmlnsAttribute(NAMESPACE).rightAngelBracket();
for (BookmarkedURL urlStorage : getBookmarkedURLS()) { for (BookmarkedURL urlStorage : getBookmarkedURLS()) {
if(urlStorage.isShared()) { if(urlStorage.isShared()) {
continue; continue;
} }
buf.openElement("url").attribute("name", urlStorage.getName()).attribute("url", urlStorage.getURL()); buf.halfOpenElement("url").attribute("name", urlStorage.getName()).attribute("url", urlStorage.getURL());
buf.condAttribute(urlStorage.isRss(), "rss", "true"); buf.condAttribute(urlStorage.isRss(), "rss", "true");
buf.closeEmptyElement(); buf.closeEmptyElement();
} }
@ -185,7 +185,7 @@ public class Bookmarks implements PrivateData {
if(conference.isShared()) { if(conference.isShared()) {
continue; continue;
} }
buf.openElement("conference"); buf.halfOpenElement("conference");
buf.attribute("name", conference.getName()); buf.attribute("name", conference.getName());
buf.attribute("autojoin", Boolean.toString(conference.isAutoJoin())); buf.attribute("autojoin", Boolean.toString(conference.isAutoJoin()));
buf.attribute("jid", conference.getJid()); buf.attribute("jid", conference.getJid());