Revision 21133 branches/v2_0_0_prep/libraries/libFMap/src/org/gvsig/fmap/mapcontext/layers/operations/VectorialXMLItem.java
VectorialXMLItem.java | ||
---|---|---|
2 | 2 |
|
3 | 3 |
import java.util.BitSet; |
4 | 4 |
|
5 |
import org.gvsig.data.ReadException; |
|
6 |
import org.gvsig.data.vectorial.FeatureStore; |
|
5 | 7 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
6 | 8 |
import org.xml.sax.ContentHandler; |
7 | 9 |
import org.xml.sax.SAXException; |
8 | 10 |
import org.xml.sax.helpers.AttributesImpl; |
9 | 11 |
|
10 |
import com.hardcode.gdbms.driver.exceptions.ReadDriverException; |
|
11 |
import com.hardcode.gdbms.engine.data.DataSource; |
|
12 | 12 |
|
13 |
|
|
14 | 13 |
public class VectorialXMLItem implements XMLItem { |
15 | 14 |
|
16 | 15 |
private BitSet bitset; |
... | ... | |
32 | 31 |
handler.startElement("", "", ((FLayer) layer).getName(), aii); |
33 | 32 |
try { |
34 | 33 |
|
35 |
DataSource ds = ((AlphanumericData) layer).getRecordset(); |
|
36 |
ds.start(); |
|
34 |
FeatureStore ds = ((AlphanumericData) layer).getFeatureStore(); |
|
35 |
//TODO |
|
36 |
// ds.start(); |
|
37 |
// |
|
38 |
// for (int j = bitset.nextSetBit(0); j >= 0; j = bitset |
|
39 |
// .nextSetBit(j + 1)) { |
|
40 |
// AttributesImpl ai = new AttributesImpl(); |
|
41 |
// |
|
42 |
// for (int k = 0; k < ds.getFieldCount(); k++) { |
|
43 |
// ai.addAttribute("", ds.getFieldName(k), "", |
|
44 |
// "xs:string", ds.getFieldValue(j, k).toString()); |
|
45 |
// } |
|
46 |
// handler.startElement("", "", String.valueOf(j), ai); |
|
47 |
// handler.endElement("", "", String.valueOf(j)); |
|
48 |
// } |
|
49 |
// |
|
50 |
// ds.stop(); |
|
37 | 51 |
|
38 |
for (int j = bitset.nextSetBit(0); j >= 0; j = bitset |
|
39 |
.nextSetBit(j + 1)) { |
|
40 |
AttributesImpl ai = new AttributesImpl(); |
|
41 |
|
|
42 |
for (int k = 0; k < ds.getFieldCount(); k++) { |
|
43 |
ai.addAttribute("", ds.getFieldName(k), "", |
|
44 |
"xs:string", ds.getFieldValue(j, k).toString()); |
|
45 |
} |
|
46 |
handler.startElement("", "", String.valueOf(j), ai); |
|
47 |
handler.endElement("", "", String.valueOf(j)); |
|
48 |
} |
|
49 |
|
|
50 |
ds.stop(); |
|
51 |
|
|
52 |
} catch (ReadDriverException e) { |
|
52 |
} catch (ReadException e) { |
|
53 | 53 |
throw new SAXException(e); |
54 | 54 |
} |
55 | 55 |
handler.endElement("", "", ((FLayer) layer).getName()); |
Also available in: Unified diff