Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Empty namespace URI in ecore?
Empty namespace URI in ecore? [message #669234] Mon, 09 May 2011 14:52 Go to next message
keller_jens is currently offline keller_jensFriend
Messages: 21
Registered: March 2010
Location: Germany
Junior Member
Hi,
I have an XML of the following structure:

<?xml version="1.0" encoding="utf-8" ?>
<langtree>
	<node id="1"/>
	<node id="2"/>
	...
</langtree>


So there's no xmlns attribute at the root element.
But if I want to model this in my ecore and try to remove the namespace URI, I always get an error "The namespace URI '' is not well formed" respectively "The namespace URI 'null' is not well formed".

Is it possible to model it so that the above XML can be parsed and my EMF model gets populated?

Regards Jens
(no subject) [message #686701 is a reply to message #669234] Tue, 10 May 2011 15:00 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
Jens,

Comments below.

Jens Keller wrote:
> Hi,
> I have an XML of the following structure:
>
> <?xml version="1.0" encoding="utf-8" ?>
> <langtree>
> <node id="1"/>
> <node id="2"/>
> ...
> </langtree>
>
> So there's no xmlns attribute at the root element.
> But if I want to model this in my ecore and try to remove
> the namespace URI, I always get an error "The namespace URI
> '' is not well formed" respectively "The namespace URI
> 'null' is not well formed".
>
> Is it possible to model it so that the above XML can be
> parsed and my EMF model gets populated?
>
Yes. Try writing a schema for that XML and import that schema to
Ecore. If you invoke Generate Test Code you'll have an XyzExample which
shows you wants needed to read and write unqualified conforming instances...
> Regards Jens
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
(no subject) [message #686858 is a reply to message #669234] Tue, 10 May 2011 15:00 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
Jens,

Comments below.

Jens Keller wrote:
> Hi,
> I have an XML of the following structure:
>
> <?xml version="1.0" encoding="utf-8" ?>
> <langtree>
> <node id="1"/>
> <node id="2"/>
> ...
> </langtree>
>
> So there's no xmlns attribute at the root element.
> But if I want to model this in my ecore and try to remove
> the namespace URI, I always get an error "The namespace URI
> '' is not well formed" respectively "The namespace URI
> 'null' is not well formed".
>
> Is it possible to model it so that the above XML can be
> parsed and my EMF model gets populated?
>
Yes. Try writing a schema for that XML and import that schema to
Ecore. If you invoke Generate Test Code you'll have an XyzExample which
shows you wants needed to read and write unqualified conforming instances...
> Regards Jens
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:(no subject)
Next Topic:Java native type array in EMF DataType
Goto Forum:
  


Current Time: Thu Apr 25 15:58:17 GMT 2024

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

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

Back to the top