Revision 4930 trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/rendering/XmlBuilder.java
XmlBuilder.java | ||
---|---|---|
17 | 17 |
// Pad unit. |
18 | 18 |
private static final String PAD = " "; |
19 | 19 |
|
20 |
// XML document header. |
|
21 |
private static final String HEADER = "<?xml version=\"1.0\"?>\n"; |
|
22 |
|
|
20 |
|
|
23 | 21 |
// Number of pre-defined pad strings, one for each pad |
24 | 22 |
// level (0..NUM_PADSTRINGS-1). Should at least be set to 10 for performance. |
25 | 23 |
private static final int NUM_PADSTRINGS = 20; |
... | ... | |
55 | 53 |
// Current pad level (0, 1, 2, ...). |
56 | 54 |
private int m_padLevel = 0; |
57 | 55 |
|
56 |
private String encoding = "UTF-8"; |
|
57 |
|
|
58 | 58 |
/* |
59 | 59 |
* Create the pad strings. |
60 | 60 |
*/ |
... | ... | |
142 | 142 |
*/ |
143 | 143 |
public void writeHeader() |
144 | 144 |
{ |
145 |
// XML document header. |
|
146 |
final String HEADER = "<?xml version=\"1.0\" encoding=\""+encoding+"\"+?>\n"; |
|
147 |
|
|
145 | 148 |
m_xml.append(HEADER); |
146 | 149 |
} |
147 | 150 |
|
148 | 151 |
/** |
152 |
* Sets the encoding used in the XML. By default UTF-8 is used. |
|
153 |
* @param encoding |
|
154 |
*/ |
|
155 |
public void setEncoding(String encoding) { |
|
156 |
this.encoding = encoding; |
|
157 |
} |
|
158 |
|
|
159 |
/** |
|
149 | 160 |
* Adds a opening and closing tag with charcter data. |
150 | 161 |
*/ |
151 | 162 |
public void writeTag(String name, String data) |
Also available in: Unified diff