118 |
serialize(node, out, false); |
serialize(node, out, false); |
119 |
} |
} |
120 |
|
|
121 |
void serialize(final Node node, final OutputStream out, |
void serialize(Node node, final OutputStream out, |
122 |
boolean convertToCdata) |
boolean convertToCdata) |
123 |
throws IOException |
throws IOException |
124 |
{ |
{ |
125 |
|
while (node != null) |
126 |
|
{ |
127 |
|
Node next = node.getNextSibling(); |
128 |
|
doSerialize(node, out, convertToCdata); |
129 |
|
node = next; |
130 |
|
} |
131 |
|
} |
132 |
|
|
133 |
|
private void doSerialize(final Node node, final OutputStream out, |
134 |
|
boolean convertToCdata) |
135 |
|
throws IOException |
136 |
|
{ |
137 |
if (out == null) |
if (out == null) |
138 |
{ |
{ |
139 |
throw new NullPointerException("no output stream"); |
throw new NullPointerException("no output stream"); |
140 |
} |
} |
141 |
String value, prefix; |
String value, prefix; |
142 |
Node children; |
Node children; |
|
Node next = node.getNextSibling(); |
|
143 |
String uri = node.getNamespaceURI(); |
String uri = node.getNamespaceURI(); |
144 |
boolean defined = false; |
boolean defined = false; |
145 |
short nt = node.getNodeType(); |
short nt = node.getNodeType(); |
477 |
{ |
{ |
478 |
undefine(uri); |
undefine(uri); |
479 |
} |
} |
|
if (next != null) |
|
|
{ |
|
|
serialize(next, out, convertToCdata); |
|
|
} |
|
480 |
} |
} |
481 |
|
|
482 |
boolean isDefined(String uri) |
boolean isDefined(String uri) |