Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » change XML schema prefix impossible using WTP XML model
change XML schema prefix impossible using WTP XML model [message #229902] Wed, 01 April 2009 16:05
Eclipse UserFriend
Originally posted by:


I'm loading an XSD model using following WTP code seen at ls/msg18292.html

However, I'm not able to change it's schema prefix then (using
XSDSchema.setSchemaForSchemaQNamePrefix(String)). Should I take
additional steps before changing the prefix, or is this a bug?

I noticed the same code works when loading model with plan EMF-XSD.

String path = "c:\\path\\to\\xml.xsd";
IStructuredDocument document = null;
IStructuredModel model = null;
ModelHandlerForXML xmlModelHandler = new ModelHandlerForXML();
IDocumentLoader loader = xmlModelHandler.getDocumentLoader();

FileInputStream file;
try {
file = new FileInputStream(path);
InputStream inputStream =Utilities.getMarkSupportedStream(file);
document = (IStructuredDocument) loader.
createNewStructuredDocument(path, inputStream,

} catch (FileNotFoundException e) {
return null;
} catch (IOException e) {
return null;

IModelLoader xmlModelLoader = xmlModelHandler.getModelLoader();
model = xmlModelLoader.createModel(document, path, xmlModelHandler);

XSDSchema schema2 = XSDModelAdapter.lookupOrCreateSchema(((IDOMModel)

System.out.println(schema2.getSchemaForSchemaNamespace()); // Prints


// prints "null", whereas should "abc"


Previous Topic:Upgrade to 3.4.1 - Run on server no longer launches initial page
Next Topic:ATTN: Konstantin - changes from 1.34 to 1.36
Goto Forum:

Current Time: Fri Apr 20 01:38:25 GMT 2018

Powered by FUDForum. Page generated in 0.01842 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software