diff --git a/src/xml_attribute.js b/src/xml_attribute.js index 02f60a8..ab151e7 100644 --- a/src/xml_attribute.js +++ b/src/xml_attribute.js @@ -35,10 +35,11 @@ XMLAttribute.prototype.render = function (){ 'class' : attributeContainerClass }).data('xmlAttribute', this).appendTo(this.xmlElement.getAttributeContainer()); - var self = this; - var removeButton = document.createElement('a'); - removeButton.appendChild(document.createTextNode('(x) ')); - this.domNode[0].appendChild(removeButton); + if(this.objectType.use != 'required') { + var removeButton = document.createElement('a'); + removeButton.appendChild(document.createTextNode('(x) ')); + this.domNode[0].appendChild(removeButton); + } var label = document.createElement('label'); var prefix = this.editor.xmlState.namespaces.getNamespacePrefix(this.objectType.namespace); diff --git a/xsd/src/schema_processor.js b/xsd/src/schema_processor.js index 342000a..6a6cb86 100644 --- a/xsd/src/schema_processor.js +++ b/xsd/src/schema_processor.js @@ -245,6 +245,7 @@ SchemaProcessor.prototype.build_attribute = function(node, definition) { } else { // Build or retrieve the type definition var type = node.getAttribute("type"); + definition.use = node.getAttribute("use"); if (type == null) { var child = this.getChildren(node)[0]; if (child)