Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Modeling (top-level project) » XML namespaces in generated models
XML namespaces in generated models [message #381897] Wed, 02 April 2008 20:40 Go to next message
Eclipse User
Originally posted by: Robertson_Don.emc.com

I noticed that in generated XMI documents the root element is namespaced
with an explicit prefixed namespace declaration, but there is no default
namespace declaration and subordinate elements are not explicitly prefixed.

For example, "elements" below is not qualified (ecore and EMF from Ganymede
distribution) ...

<?xml version="1.0" encoding="UTF-8"?>
<rdb:Schema xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:rdb="http://www.eclipse.org/qvt/1.0.0/Operational/examples/rdb">
<elements xsi:type="rdb:Table"/>
</rdb:Schema>

My understanding of XML is that the subordinate elements are not within a
namespace - containment only offers visibility to in-scope namespace
declarations, not implicit namespace assignment (except to an in-scope
default namespace).

Is this the intended behavior? If so, it complicates the use of XMI
documents in an XML repository (eg. with XQuery). And I can't see a point to
it.

Hopefully I am just plain wrong. If not, I know I can control serialization,
but as a default behavior this means the whole organization will have to do
so if we are to have EMF-generated documents co-resident in a repository.

Any comments?
Re: XML namespaces in generated models [message #381898 is a reply to message #381897] Wed, 02 April 2008 21:14 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 26087
Registered: July 2009
Senior Member
Don,

Thanks for preemptively posting to the EMF newsgroup.


Robertson, Don wrote:
> I noticed that in generated XMI documents the root element is namespaced
> with an explicit prefixed namespace declaration, but there is no default
> namespace declaration and subordinate elements are not explicitly prefixed.
>
> For example, "elements" below is not qualified (ecore and EMF from Ganymede
> distribution) ...
>
> <?xml version="1.0" encoding="UTF-8"?>
> <rdb:Schema xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:rdb="http://www.eclipse.org/qvt/1.0.0/Operational/examples/rdb">
> <elements xsi:type="rdb:Table"/>
> </rdb:Schema>
>
> My understanding of XML is that the subordinate elements are not within a
> namespace - containment only offers visibility to in-scope namespace
> declarations, not implicit namespace assignment (except to an in-scope
> default namespace).
>
> Is this the intended behavior? If so, it complicates the use of XMI
> documents in an XML repository (eg. with XQuery). And I can't see a point to
> it.
>
> Hopefully I am just plain wrong. If not, I know I can control serialization,
> but as a default behavior this means the whole organization will have to do
> so if we are to have EMF-generated documents co-resident in a repository.
>
> Any comments?
>
>
Re: XML namespaces in generated models [message #606573 is a reply to message #381897] Wed, 02 April 2008 21:14 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 26087
Registered: July 2009
Senior Member
Don,

Thanks for preemptively posting to the EMF newsgroup.


Robertson, Don wrote:
> I noticed that in generated XMI documents the root element is namespaced
> with an explicit prefixed namespace declaration, but there is no default
> namespace declaration and subordinate elements are not explicitly prefixed.
>
> For example, "elements" below is not qualified (ecore and EMF from Ganymede
> distribution) ...
>
> <?xml version="1.0" encoding="UTF-8"?>
> <rdb:Schema xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:rdb="http://www.eclipse.org/qvt/1.0.0/Operational/examples/rdb">
> <elements xsi:type="rdb:Table"/>
> </rdb:Schema>
>
> My understanding of XML is that the subordinate elements are not within a
> namespace - containment only offers visibility to in-scope namespace
> declarations, not implicit namespace assignment (except to an in-scope
> default namespace).
>
> Is this the intended behavior? If so, it complicates the use of XMI
> documents in an XML repository (eg. with XQuery). And I can't see a point to
> it.
>
> Hopefully I am just plain wrong. If not, I know I can control serialization,
> but as a default behavior this means the whole organization will have to do
> so if we are to have EMF-generated documents co-resident in a repository.
>
> Any comments?
>
>
Previous Topic:XML namespaces in generated models
Next Topic:[Announcement] Eclipse/OMG Symposium at the OMG Technical Meeting in Ottawa
Goto Forum:
  


Current Time: Wed Oct 01 00:13:59 GMT 2014

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

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