nameEl.appendChild(doc.createTextNode(node.getName()));
edEl.appendChild(nameEl);
// determine element type
if (elType.equals("folder")) {
// target is a folder
StructureStylesheetUserPreferences ssup = context.getUserPreferences().getStructureStylesheetUserPreferences();
Element saEl = doc.createElement("structureattributes");
for (Enumeration fe = ssup.getFolderAttributeNames(); fe.hasMoreElements();) {
Element atEl = doc.createElement("attribute");
Element atNameEl = doc.createElement("name");
String atName = (String)fe.nextElement();
atNameEl.appendChild(doc.createTextNode(atName));
atEl.appendChild(atNameEl);
Element valueEl = doc.createElement("value");
String value = ssup.getFolderAttributeValue(editElementID, atName);
if (value == null) {
// set the default value
value = context.getStructureStylesheetDescription().getFolderAttributeDefaultValue(atName);
}
valueEl.appendChild(doc.createTextNode(value));
atEl.appendChild(valueEl);
Element descrEl = doc.createElement("description");
descrEl.appendChild(doc.createTextNode(context.getStructureStylesheetDescription().getFolderAttributeWordDescription(atName)));
atEl.appendChild(descrEl);
saEl.appendChild(atEl);
}
edEl.appendChild(saEl);
} else if (elType.equals("channel")) {
// target is a channel
StructureStylesheetUserPreferences ssup = context.getUserPreferences().getStructureStylesheetUserPreferences();
Element saEl = doc.createElement("structureattributes");
for (Enumeration ce = ssup.getChannelAttributeNames(); ce.hasMoreElements();) {
Element atEl = doc.createElement("attribute");
Element atNameEl = doc.createElement("name");
String atName = (String)ce.nextElement();
atNameEl.appendChild(doc.createTextNode(atName));
atEl.appendChild(atNameEl);
Element valueEl = doc.createElement("value");
String value = ssup.getChannelAttributeValue(editElementID, atName);
if (value == null) {
value = context.getStructureStylesheetDescription().getChannelAttributeDefaultValue(atName);
}
valueEl.appendChild(doc.createTextNode(value));
atEl.appendChild(valueEl);