suggestion to use namespace prefix for nsPrefix in XSD2eCore mapping [message #598585] |
Sun, 20 August 2006 13:13 |
Matthew Rawlings 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
|
|
|
Powered by
FUDForum. Page generated in 0.03322 seconds