root.appendChild(isDeleted);
// create attribute elements
Element attrElement = doc.createElementNS(ns, "Attributes");
root.appendChild(attrElement);
OCMetadataAttributeCollection attributeMetaCollection = metadata.getAttributes();
OCAttributeMetadataObject amoTmp = null;
int amcSZ = attributeMetaCollection.size();
for (int z = 0; z < amcSZ; z++) {
amoTmp = attributeMetaCollection.get(z);
String oName = amoTmp.getName();
//String tName = transliterate(oName);
Element elem = doc.createElementNS(ns, "Attribute");
elem.setAttribute("name", oName);
OCVariant var = documentObject.getAttributeValue(oName);
Object varValue = var.value();
int typeCode = var.getTypeCode();
boolean isRef = (typeCode > 99);
Object attrVal = documentObject.getAttributeValue(oName).value();
//handle different type of types
if (attrVal instanceof Date) {
attrVal = sdFormat.format(attrVal);
}
elem.setTextContent(attrVal.toString());
if (showIsRefAttribute) {
elem.setAttribute("isRef", String.valueOf(isRef));
}
if (isRef) {
if (showRefType && varValue instanceof _OCCommonRef) {
elem.setAttribute("refType", ((_OCCommonRef) varValue).getMetadata().getFullName());
} else
if (showRefType && varValue instanceof OCEnumRef ) {
elem.setAttribute("refType", ((OCEnumRef) varValue).getMetadata().getFullName());
}
if (showRefGUID && varValue instanceof _OCCommonRef) {
elem.setAttribute("guid", ((_OCCommonRef) varValue).getUUID().toString());
}
}
attrElement.appendChild(elem);
}
// create table section
Element tabSections = doc.createElementNS(ns, "TabularSections");
root.appendChild(tabSections);
OCMetadataTabularSectionCollection tabSecCollection = metadata.getTabularSections();
int tabSecColSZ = tabSecCollection.size();
for (int z = 0; z < tabSecColSZ; z++) {
OCTabularSectionMetadataObject tsmO = tabSecCollection.get(z);
OCMetadataAttributeCollection tsAttrMetadata = tsmO.getAttributes();
String tabSecName = tsmO.getName();
Element tabSection = doc.createElementNS(ns, "TabularSection");
tabSection.setAttribute("name", tabSecName);
tabSections.appendChild(tabSection);