|
Re: <appinfo> tag not generated during model export to XSD [message #1706720 is a reply to message #1706581] |
Sat, 29 August 2015 07:11 |
Ed Merks Messages: 33113 Registered: July 2009 |
Senior Member |
|
|
Jim,
For the purpose of converting to XML Schema, these two annotations
sources are ignored:
protected boolean isIgnoredAnnotationSource(String sourceURI)
{
return
EcorePackage.eNS_URI.equals(sourceURI) ||
ExtendedMetaData.ANNOTATION_URI.equals(sourceURI) ||
GEN_MODEL_PACKAGE_NS_URI.equals(sourceURI);
}
Otherwise the behavior is quite subtle. If the value has no newlines
it's coverted to a non-schema namespace attribute:
<eAnnotations source="foo">
<details key="appinfo" value="Foo"/>
</eAnnotations>
->
<xsd:schema xmlns:foo="foo" foo:appinfo="Foo" ...
If it contains a newline, it's converted to an appinfo.
<eAnnotations source="bar">
<details key="appinfo" value="
Bar"/>
</eAnnotations>
->
<xsd:annotation>
<xsd:appinfo ecore:key="appinfo" source="bar">
Bar</xsd:appinfo>
On 28/08/2015 3:02 PM, Jim Boone wrote:
> Hi,
>
> I am new to EMF and an attempting to define a domin model using EMF.
> I have defined an eAttribute and documented it with an eAnnotation. I
> want to be able to generate a XSD that has both a documentation and
> appinfo tag like this:
>
>
> <xsd:annotation>
> <xsd:documentation> attribute information</xsd:documentation>
> <xsd:appinfo> application specific info for attribute <xsd:appinfo>
> </xsd:annotation>
>
>
> The following shows the excerpt from the ecore file the way I would
> expect the eAnnotation to be defined in EMF:
>
>
> <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
> <details key="documentation" value="attribute information"/>
> <details key="appinfo" value="application specific info for
> attribute"/>
> </eAnnotations>
>
>
> The problem is, when I generate the XSD from the ecore file, I do not
> see the appinfo information. Only the documentation tag is generated
> (e.g.
> <xsd:annotation>
> <xsd:documentation> attribute information</xsd:documentation>
> </xsd:annotation>
>
>
> The book "EMF: Eclipse Modeling Framework, Second Edition" says Quote:
>> "An xsd:appinfo element in a schema component's xsd:annotation maps
>> to an EAnnotation whose source is the same as the source attribute of
>> the xsd:appinfo, or null if none is provided. The EAnnotation's
>> details map contains a single entry:
>>
>> •key = "appinfo", value = the contents of the xsd:appinfo element"
>
>
> The book implies that it is a no-brainer to create an appinfo tag in
> the XSD. I have tried to define the appinfo annotation in almost every
> combination but with no luck. Is this a bug or am is missing
> something? Thanks in advance for the help.
>
> Regards,
> --Jim
>
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.01745 seconds