Hi ,
Iam trying to create a xsd document using the org.eclipse.xsd package
My code for creating xsdschema is given below
XSDFactory xsdFactory=XSDFactory.eINSTANCE;
XSDSchema xsdSchema = xsdFactory.createXSDSchema();
xsdSchema.setTargetNamespace("http://www.example.com/PrototypicalSchema");
xsdSchema.setElementFormDefault(XSDForm.QUALIFIED_LITERAL);
xsdSchema.setAttributeFormDefault(XSDForm.QUALIFIED_LITERAL);
xsdSchema.setSchemaForSchemaQNamePrefix("xsd");
Map qNamePrefixToNamespaceMap = xsdSchema.getQNamePrefixToNamespaceMap();
qNamePrefixToNamespaceMap.put("PTS", xsdSchema.getTargetNamespace());
qNamePrefixToNamespaceMap.put(xsdSchema.getSchemaForSchemaQNamePrefix(),
XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001);
qNamePrefixToNamespaceMap.put("EXT", "http://www.example.com/SomeOtherSchema");
After creating the xsdschema
If I use xsdSchema.getSchemaForSchema(); iam getting the below error
Error trace
java.lang.NullPointerException
at org.eclipse.emf.common.EMFPlugin.getBaseURL(EMFPlugin.java:89)
at org.eclipse.xsd.impl.XSDSchemaImpl.getSchemaForSchema(XSDSchemaImpl.java:627)
at org.eclipse.xsd.impl.XSDSchemaImpl.getSchemaForSchema(XSDSchemaImpl.java:2111)
Can any body help me in solving this problem.
My problem should be in setting the baseurl
for EMFPlugin
george