Revision 4915 trunk/extensions/extWMS/src/com/iver/cit/gvsig/fmap/layers/FLyrWMS.java

View differences:

FLyrWMS.java
1290 1290
				// </Server>
1291 1291
				
1292 1292
				// <Name>
1293
				xml.openTag(WebMapContextTags.NAME);
1294
				xml.writeRaw(layer.getName());
1295
				xml.closeTag();
1293
				xml.writeTag(WebMapContextTags.NAME, layer.getName().trim());
1296 1294
				// </Name>
1297 1295
				
1298 1296
				// <Title>
1299
				xml.openTag(WebMapContextTags.TITLE);
1300
				xml.writeRaw(layer.getTitle());
1301
				xml.closeTag();
1297
				xml.writeTag(WebMapContextTags.TITLE, layer.getTitle().trim());
1302 1298
				// </Title>
1303 1299
				
1304 1300
				// <Abstract>
1305
				xml.openTag(WebMapContextTags.ABSTRACT);
1306
				xml.writeRaw(layer.getAbstract());
1307
				xml.closeTag();
1301
				if (layer.getAbstract() != null)
1302
					xml.writeTag(WebMapContextTags.ABSTRACT, layer.getAbstract());
1308 1303
				// </Abstract>
1309 1304
				
1310 1305
				// <SRS> (a list of available SRS for the enclosing layer)
1311
				xml.openTag(WebMapContextTags.SRS);
1312 1306
				String[] strings = (String[]) layer.getAllSrs().toArray(new String[0]);
1313 1307
				String mySRS = strings[0];
1314 1308
				for (int j = 1; j < strings.length; j++) {
1315 1309
					mySRS += ","+strings[j];
1316 1310
				}
1317
				xml.writeRaw(mySRS);
1318
				xml.closeTag();
1311
				xml.writeTag(WebMapContextTags.SRS, mySRS);
1319 1312
				// </SRS>
1320 1313
				
1321 1314
				// <FormatList>
......
1323 1316
					strings = (String[]) drv.getFormats().toArray(new String[0]);
1324 1317
					for (int j = 0; j < strings.length; j++) {
1325 1318
                    // <Format>
1326
						if (strings[i].equals(getFormat()))
1327
							xmlAttrs.put(WebMapContextTags.CURRENT, "1");
1328
						xml.writeTag(WebMapContextTags.FORMAT, xmlAttrs);
1329
						xmlAttrs.clear();
1319
						String str = strings[j].trim();
1320
						if (str.equals(getFormat()))
1321
							xml.writeTag(WebMapContextTags.FORMAT, str, WebMapContextTags.CURRENT, "1");
1322
						else
1323
							xml.writeTag(WebMapContextTags.FORMAT, str);
1330 1324
                    // </Format>	
1331 1325
					}
1332 1326
				xml.closeTag();
1333 1327
				// </FormatList>
1334 1328
				
1335 1329
				// <StyleList>
1330
				if (layer.getStyles().size()>0) {
1336 1331
				xml.openTag(WebMapContextTags.STYLE_LIST);
1337 1332
					for (int j = 0; j < layer.getStyles().size(); j++) {
1338 1333
						// <Style>
......
1342 1337
						xml.openTag(WebMapContextTags.STYLE, xmlAttrs);
1343 1338
						
1344 1339
							// <Name>
1345
							xml.openTag(WebMapContextTags.NAME);
1346
							xml.writeRaw(st.name);
1347
							xml.closeTag();
1340
							xml.writeTag(WebMapContextTags.NAME, st.name);
1348 1341
							// </Name>
1349 1342
							
1350 1343
							// <Title>
1351
							xml.openTag(WebMapContextTags.TITLE);
1352
							xml.writeRaw(st.title);
1353
							xml.closeTag();
1344
							xml.writeTag(WebMapContextTags.TITLE, st.title);
1354 1345
							// </Title>
1355 1346
							
1356 1347
							// <LegendURL width="180" format="image/gif" height="50">
......
1360 1351
						// </Style>
1361 1352
						xml.closeTag();
1362 1353
					}
1354
				}
1363 1355
				// </StyleList>
1364 1356
				// <DimensionList>
1365 1357
					// <Dimension>
......
1374 1366
			// </Layer>
1375 1367
			xml.closeTag();
1376 1368
		}
1377
		return xml.toString();
1369
		return xml.getXML();
1378 1370
	}
1379 1371
}

Also available in: Unified diff