Show TOC

XML ModelLocate this document in the navigation structure

The XML model allows to bind controls to XML data. It is a client-side model intended for small datasets, which are completely available on the client. The XML model does not contain mechanisms for server-based paging or loading of deltas. It supports two-way binding.

To instantiate the model, use the following code:
var oModel = new sap.ui.model.xml.XMLModel();
The XML model allows to bind controls to XML data. It is a client-side model intended for small data sets, which are completely available on the client. The XML model does not contain mechanisms for server-based paging or loading of deltas. It supports two-way binding.
oModel.setData(oXMLDocument);
To create inline XML data or to get XML data as a string, the XML model provides a setXML method. This method takes XML in text format and uses the browser's XML parser to create a document.
oModel.setXML("<?xml version=\"1.0\"?><some><xml>data</xml></some>");
Usually, you load your data from the server using an HTTP-based service, so the loadData method provides an easy way to load XML data from the given URL:
oModel.loadData("data.xml");