public void produce( LDAPAttributeSchema schema )
throws SAXException
{
AttributeListImpl attrList;
leaveDirectory();
enterSchema();
attrList = new AttributeListImpl();
// dsml:attribute id
attrList.addAttribute( XML.Schema.Attributes.Id, "ID", schema.getName() );
// dsml:attribute superior
if ( schema.getSuperior() != null ) {
attrList.addAttribute( XML.Schema.Attributes.Superior, "CDATA", "#" + schema.getSuperior() );
}
// dsml:attribute obsolete
attrList.addAttribute( XML.Schema.Attributes.Obsolete, null,
schema.isObsolete() ? "true" : "false" );
// dsml:attribute single-value
attrList.addAttribute( XML.Schema.Attributes.SingleValue, null,
schema.isSingleValued() ? "true" : "false" );
// dsml:attribute user-modification
// XXX
// dsml:attribute
_docHandler.startElement( prefix( XML.Schema.Elements.AttributeType) , attrList );
// dsml:attribute name
if ( schema.getName() != null ) {
attrList = new AttributeListImpl();
_docHandler.startElement( prefix( XML.Schema.Elements.Name ), attrList );
_docHandler.characters( schema.getName().toCharArray(), 0,
schema.getName().length() );
_docHandler.endElement( prefix( XML.Schema.Elements.Name ) );
}
// dsml:attribute description
if ( schema.getDescription() != null ) {
attrList = new AttributeListImpl();
_docHandler.startElement( prefix( XML.Schema.Elements.Description ), attrList );
_docHandler.characters( schema.getDescription().toCharArray(), 0,
schema.getDescription().length() );
_docHandler.endElement( prefix( XML.Schema.Elements.Description ) );
}
// dsml:attribute object-identifier
if ( schema.getID() != null ) {
attrList = new AttributeListImpl();
_docHandler.startElement( prefix( XML.Schema.Elements.OID ), attrList );
_docHandler.characters( schema.getID().toCharArray(), 0,
schema.getID().length() );
_docHandler.endElement( prefix( XML.Schema.Elements.OID ) );
}
// dsml:attribute syntax
if ( schema.getSyntaxString() != null ) {
attrList = new AttributeListImpl();
_docHandler.startElement( prefix( XML.Schema.Elements.Syntax ), attrList );
_docHandler.characters( schema.getSyntaxString().toCharArray(), 0,
schema.getSyntaxString().length() );
_docHandler.endElement( prefix( XML.Schema.Elements.Syntax ) );
}