|
|
Re: Missing support for XML Schema documentation annotation [message #813507 is a reply to message #812074] |
Mon, 05 March 2012 10:54 |
Markus Stier Messages: 12 Registered: July 2009 |
Junior Member |
|
|
I'm writing a generic XML editor similar to the EMF reflective editor based on a XML Schema meta model. I want to use localized labels for the elements in the XML editor. The editor will contain a 'help' pane which will show localized information about the focused element. Localized labels and information are stored in xs:documentation annotations. I wanted to use ecore as mature component. Is there any reason (besides no need for more functionality) that ecore merges the xs:documentation elements?
Is there any chance, that an enhancement I'll provide will make it to ecore releases?
Best
Markus
Ed Merks wrote on Sat, 03 March 2012 01:59Markus,
Yes, that's just how it works. You'd need to write your own
specialized XSDEcoreBuilder to get something different. What were you
hoping to do with this information?
On 02/03/2012 4:47 PM, Markus Stier wrote:
> Hi!
>
> I'm currently using ecore XSD to parse and analyze XML schema files.
> These schema files make excessive use of xsd:annotations especially
> xsd:documentation.
> The xsd:documentation entities contain source and lang attributes to
> distinguish between usage (label, description, technical info) and
> language (english, german, french). ecore xsd merges all documentation
> annotation into a single string. The information about language and
> usage is lost.
> I found this mapping documentation, which describes exactly what I see
> (page 28):
> (cannot post links)...\XMLSchemaToEcoreMapping.pdf
>
> I this still state of the art? Anything I can do about it?
>
> Best Markus
>
>
|
|
|
Re: Missing support for XML Schema documentation annotation [message #813549 is a reply to message #813507] |
Mon, 05 March 2012 12:08 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
Markus,
The documentation is converted to something that EMF will use in the
generated model's Javadoc. Perhaps you can keep the original schema
around too and use the extended meta data to map back to the
corresponding components. Or you can use the same approach to populate
your own style of EAnnotations. I'm not sure what you're suggesting as
a general mapping from documentation annotations to Ecore annotations...
On 05/03/2012 11:54 AM, Markus Stier wrote:
> I'm writing a generic XML editor similar to the EMF reflective editor
> based on a XML Schema meta model. I want to use localized labels for
> the elements in the XML editor. The editor will contain a 'help' pane
> which will show localized information about the focused element.
> Localized labels and information are stored in xs:documentation
> annotations. I wanted to use ecore as mature component. Is there any
> reason (besides no need for more functionality) that ecore merges the
> xs:documentation elements? Is there any chance, that an enhancement
> I'll provide will make it to ecore releases?
>
> Best
> Markus
>
> Ed Merks wrote on Sat, 03 March 2012 01:59
>> Markus,
>>
>> Yes, that's just how it works. You'd need to write your own
>> specialized XSDEcoreBuilder to get something different. What were
>> you hoping to do with this information?
>>
>>
>> On 02/03/2012 4:47 PM, Markus Stier wrote:
>> > Hi!
>> >
>> > I'm currently using ecore XSD to parse and analyze XML schema
>> files. > These schema files make excessive use of xsd:annotations
>> especially > xsd:documentation.
>> > The xsd:documentation entities contain source and lang attributes
>> to > distinguish between usage (label, description, technical info)
>> and > language (english, german, french). ecore xsd merges all
>> documentation > annotation into a single string. The information
>> about language and > usage is lost.
>> > I found this mapping documentation, which describes exactly what I
>> see > (page 28):
>> > (cannot post links)...\XMLSchemaToEcoreMapping.pdf
>> >
>> > I this still state of the art? Anything I can do about it?
>> >
>> > Best Markus
>> >
>> >
>
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
Re: Missing support for XML Schema documentation annotation [message #813737 is a reply to message #813683] |
Mon, 05 March 2012 16:56 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
Markus,
Yes XML Schema -> Ecore -> XML Schema is definitely a lossy process.
Ecore -> XML Schema -> Ecore is designed to be non-lossy. We simply
can't and don't capture all the arbitrary DOM structure that can appear
in general (and don't capture every detail of the particle structure for
a complex type, nor key constraints).
On 05/03/2012 4:50 PM, Markus Stier wrote:
> Ed,
>
> besides being able to edit XML-files based on an XML schema I want to
> use ecore to create a very simplified XSD editor (manly for
> translation purposes). It will be crucial for me to be able to
> re-export the XSD-file after translating some xs:documentation elements.
> A general mapping for xs:documentation would be to create an
> EAnnotation for each xs:documentation. The source attribute of
> xs:documentation will go to EAnnotation.Source. The lang attribute and
> the body will be converted to Details.
> Very similar to how it is done with xs:appinfo. Those EAnnotations
> might be used or written back to their original structure, as
> described above.
>
> BTW: Writing back xs:appinfo elements does not re-create appropriate
> xs:appinfo elements but attributes below the containing element thus
> modifying the structure...
> Is a XSD-ecore-XSD round trip out of scope of ecore XSD? Or is this
> just- a bug?
>
> Markus
>
> Ed Merks wrote on Mon, 05 March 2012 07:08
>> Markus,
>>
>> The documentation is converted to something that EMF will use in the
>> generated model's Javadoc. Perhaps you can keep the original schema
>> around too and use the extended meta data to map back to the
>> corresponding components. Or you can use the same approach to
>> populate your own style of EAnnotations. I'm not sure what you're
>> suggesting as a general mapping from documentation annotations to
>> Ecore annotations...
>
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03324 seconds