Provides example snippets to understand the use of SDMParser APIs.
try { //Parsing a feed or a single entry. //Assuming that schema and service document already parsed //and collection selected List<ISDMODataEntry> entries = parser.parseODataEntriesXML(responseXML,collectionId,schema); //Assuming there is at least one entry in the feed. ISDMODataEntry entry = entries.get(0); //Retrieving the valid property meta data from the given SDMOdataSchema. List<ISDMODataProperty> properties = entry.getPropertiesData(); //Assuming there is at least one property for the entry. ISDMODataProperty property = properties.get(0); boolean visibleInList = property.getAttribute("visible-in-list"); String value; if (visibleInList) { value = property.getValue(); } else { value = "invisible"; } } catch(SDMParserException e) {}
private SDMODataEntry entryDoc; //entryDoc corresponds to the XML document with entries String eTag = entryDoc.getEtag(); //Passes a null value if the document does not contain an ETag.