Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » XML Schema Definition (XSD) » suggestion to use namespace prefix for nsPrefix in XSD2eCore mapping
suggestion to use namespace prefix for nsPrefix in XSD2eCore mapping [message #598585] Sun, 20 August 2006 13:13
Matthew Rawlings is currently offline Matthew RawlingsFriend
Messages: 39
Registered: July 2009
Member
This is a suggestion to map the namespace prefix in the XML Schema to the
nsPrefix in eCore.

Section 1.2, "Schema with Target Namespace", of the document
"XMLSchemaToEcoreMapping"
http://www.eclipse.org/emf/docs/overviews/XMLSchemaToEcoreMa pping.pdf states
that the nsPrefix is derived from the targetNamespace. I suggest that the
nsPrefix is instead derived from the XML Schema namespace prefix instead
whenever it is present. This is a proposed to change to this specification.

Using this example:
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:fpml="http://www.fpml.org/2005/FpML-4-2"
targetNamespace=http://www.fpml.org/2005/FpML-4-2>

Today this correctly creates from the targetNamespace a nsPrefix of: "_2"
according to the algorithm.

In cases where the namespace has a defined prefix in the schema the
algorithm is redundant because the namespace name is already defined. For
the above example it can be seen that the namespace prefix defined in the
schema is "fpml". The use of "fpml" in the eCore is consistent with the XSD,
much more so than "_2".

Today I achieve this workaround with schema annotations. I believe that the
specification should be emended to make use of predefined prefixes where
they exist.

- Matthew
Previous Topic:xsd2ecore
Next Topic:suggestion to use namespace prefix for nsPrefix in XSD2eCore mapping
Goto Forum:
  


Current Time: Thu Apr 25 09:50:15 GMT 2024

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

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

Back to the top