SWGetRecords format additions for sorting, p=fvanderbiest, r=me,bartvde (closes #2952)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@11957 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Éric Lemoine
2011-05-09 07:16:39 +00:00
parent c0112c9bc6
commit 491a5c0f62
4 changed files with 72 additions and 16 deletions
+26 -1
View File
@@ -336,7 +336,32 @@
return new OpenLayers.Format.XML().read(xml).documentElement;
}
function test_SortBy(t) {
t.plan(1);
var out =
'<ogc:SortBy xmlns:ogc="http://www.opengis.net/ogc">'+
'<ogc:SortProperty>'+
'<ogc:PropertyName>Title</ogc:PropertyName>'+
'<ogc:SortOrder>ASC</ogc:SortOrder>'+
'</ogc:SortProperty>'+
'<ogc:SortProperty>'+
'<ogc:PropertyName>Relevance</ogc:PropertyName>'+
'<ogc:SortOrder>DESC</ogc:SortOrder>'+
'</ogc:SortProperty>'+
'</ogc:SortBy>';
var parser = new OpenLayers.Format.Filter.v1_1_0();
var node = parser.writers['ogc'].SortBy.call(parser, [{
"property": 'Title',
"order": "ASC"
},{
"property": 'Relevance',
"order": "DESC"
}]);
t.xml_eq(node, out, "Check SortBy");
}
</script>
</head>
<body>