215 node.setAttribute("text", toISO8859(text));
216
217 root.appendChild(node);
218 }
219
220 // Application extensions
221 int numAppExtensions = applicationIDs == null ?
222 0 : applicationIDs.size();
223 if (numAppExtensions > 0) {
224 node = new IIOMetadataNode("ApplicationExtensions");
225 for (int i = 0; i < numAppExtensions; i++) {
226 IIOMetadataNode appExtNode =
227 new IIOMetadataNode("ApplicationExtension");
228 byte[] applicationID = (byte[])applicationIDs.get(i);
229 appExtNode.setAttribute("applicationID",
230 toISO8859(applicationID));
231 byte[] authenticationCode = (byte[])authenticationCodes.get(i);
232 appExtNode.setAttribute("authenticationCode",
233 toISO8859(authenticationCode));
234 byte[] appData = (byte[])applicationData.get(i);
235 appExtNode.setUserObject((byte[])appData.clone());
236 node.appendChild(appExtNode);
237 }
238
239 root.appendChild(node);
240 }
241
242 // Comment extensions
243 int numComments = comments == null ? 0 : comments.size();
244 if (numComments > 0) {
245 node = new IIOMetadataNode("CommentExtensions");
246 for (int i = 0; i < numComments; i++) {
247 IIOMetadataNode commentNode =
248 new IIOMetadataNode("CommentExtension");
249 byte[] comment = (byte[])comments.get(i);
250 commentNode.setAttribute("value", toISO8859(comment));
251 node.appendChild(commentNode);
252 }
253
254 root.appendChild(node);
255 }
|
215 node.setAttribute("text", toISO8859(text));
216
217 root.appendChild(node);
218 }
219
220 // Application extensions
221 int numAppExtensions = applicationIDs == null ?
222 0 : applicationIDs.size();
223 if (numAppExtensions > 0) {
224 node = new IIOMetadataNode("ApplicationExtensions");
225 for (int i = 0; i < numAppExtensions; i++) {
226 IIOMetadataNode appExtNode =
227 new IIOMetadataNode("ApplicationExtension");
228 byte[] applicationID = (byte[])applicationIDs.get(i);
229 appExtNode.setAttribute("applicationID",
230 toISO8859(applicationID));
231 byte[] authenticationCode = (byte[])authenticationCodes.get(i);
232 appExtNode.setAttribute("authenticationCode",
233 toISO8859(authenticationCode));
234 byte[] appData = (byte[])applicationData.get(i);
235 appExtNode.setUserObject(appData.clone());
236 node.appendChild(appExtNode);
237 }
238
239 root.appendChild(node);
240 }
241
242 // Comment extensions
243 int numComments = comments == null ? 0 : comments.size();
244 if (numComments > 0) {
245 node = new IIOMetadataNode("CommentExtensions");
246 for (int i = 0; i < numComments; i++) {
247 IIOMetadataNode commentNode =
248 new IIOMetadataNode("CommentExtension");
249 byte[] comment = (byte[])comments.get(i);
250 commentNode.setAttribute("value", toISO8859(comment));
251 node.appendChild(commentNode);
252 }
253
254 root.appendChild(node);
255 }
|