Example of parsing a WMS GetCapabilities response.
This example shows the contents of the result object from parsing a WMS capabilities response.
<!DOCTYPE html> <html> <head> <title>WMS GetCapabilities parsing example</title> <script src="https://code.jquery.com/jquery-1.11.2.min.js"></script> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css"> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ol3/3.6.0/ol.css" type="text/css"> <script src="https://cdnjs.cloudflare.com/ajax/libs/ol3/3.6.0/ol.js"></script> <style> .log-container { height: 400px; overflow: scroll; } </style> </head> <body> <div class="container-fluid"> <div class="row-fluid"> <div class="span12"> <pre class="log-container"><code id="log"></code></pre> </div> </div> </div> <script> var parser = new ol.format.WMSCapabilities(); $.ajax('data/ogcsample.xml').then(function(response) { var result = parser.read(response); $('#log').html(window.JSON.stringify(result, null, 2)); }); </script> </body> </html>