Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[xsd-dev] Problem with xsdSchema.getSchemaForSchema()

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

 

**************************Disclaimer**************************************************    
 
 Information contained in this E-MAIL being proprietary to Wipro Limited is 'privileged' 
and 'confidential' and intended for use only by the individual or entity to which it is 
addressed. You are notified that any use, copying or dissemination of the information 
contained in the E-MAIL in any manner whatsoever is strictly prohibited.

****************************************************************************************

Back to the top