import javax.xml.bind.JAXBElement;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
+import javax.xml.namespace.QName;
import org.simantics.utils.datastructures.MapList;
import org.simantics.xml.sax.configuration.Configuration;
header[3] = "Date " + new Date().toString();
schemaNs = schema.getTargetNamespace();
+
ontologyUri = schemaNs;
if (ontologyUri == null) {
ontologyUri = getSchemaFile().getName();
int index = ontologyUri.lastIndexOf(".");
if (index > 0)
ontologyUri = ontologyUri.substring(0, index);
+ schemaNs = "";
}
ontologyUri = ontologyUri.replaceAll(" ", "_");
String parts[] = ontologyUri.split("/");
}
public boolean isPrimary() {
- return getRoot().schemaNSMap.getValues(schemaNs).indexOf(this) == 0;
+ return getRoot() == this;
+ }
+
+ public String getShortName(String namespaceURI) {
+ List<SchemaConverter> converters = getRoot().getConverter(namespaceURI);
+ for (SchemaConverter conv : converters) {
+ if (conv.shortName != null)
+ return conv.shortName;
+ }
+ return null;
+ }
+
+ public String getOntologyClassName(String namespaceURI) {
+ List<SchemaConverter> converters = getRoot().getConverter(namespaceURI);
+ for (SchemaConverter conv : converters) {
+ if (conv.className != null)
+ return conv.className;
+ }
+ return null;
}