use of com.genexus.xml.XMLReader in project JavaClasses by genexuslabs.
the class GXBaseCollection method fromxml.
@Override
public boolean fromxml(String xml, GXBaseCollection<SdtMessages_Message> messages, String collName) {
try {
XMLReader reader = new XMLReader();
reader.openFromString(xml);
short result;
result = readCollectionFromXML(reader);
reader.close();
if (result <= 0) {
CommonUtil.ErrorToMessages(String.valueOf(reader.getErrCode()), reader.getErrDescription(), messages);
return false;
} else
return true;
} catch (Exception ex) {
CommonUtil.ErrorToMessages("fromxml error", ex.getMessage(), messages);
return false;
}
}
use of com.genexus.xml.XMLReader in project JavaClasses by genexuslabs.
the class GXSimpleCollection method fromxml.
public boolean fromxml(String xml, GXBaseCollection<SdtMessages_Message> messages, String collName) {
try {
if (SpecificImplementation.Application.getProperty("SIMPLE_XML_SUPPORT", "0").equals("1")) {
xml = xml.replaceAll("<item>", "<item class=\"" + elementsType.getName() + "\">");
GXXMLSerializer.deserializeSimpleXml(this, xml);
return true;
} else {
XMLReader reader = new XMLReader();
reader.openFromString(xml);
short result;
result = readIntegralCollectionFromXML(reader, "item");
reader.close();
if (result <= 0) {
CommonUtil.ErrorToMessages(String.valueOf(reader.getErrCode()), reader.getErrDescription(), messages);
return false;
} else
return true;
}
} catch (Exception ex) {
CommonUtil.ErrorToMessages("fromxml error", ex.getMessage(), messages);
return false;
}
}
Aggregations