Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Missing support for XML Schema documentation annotation(Documentation annotation merged to useless text)
Missing support for XML Schema documentation annotation [message #811613] Fri, 02 March 2012 15:47 Go to next message
Markus Stier is currently offline Markus StierFriend
Messages: 12
Registered: July 2009
Junior Member
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 #812074 is a reply to message #811613] Sat, 03 March 2012 06:59 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
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 #813507 is a reply to message #812074] Mon, 05 March 2012 10:54 Go to previous messageGo to next message
Markus Stier is currently offline Markus StierFriend
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: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
>
>

Re: Missing support for XML Schema documentation annotation [message #813549 is a reply to message #813507] Mon, 05 March 2012 12:08 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
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 #813683 is a reply to message #813549] Mon, 05 March 2012 15:50 Go to previous messageGo to next message
Markus Stier is currently offline Markus StierFriend
Messages: 12
Registered: July 2009
Junior Member
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...


Re: Missing support for XML Schema documentation annotation [message #813737 is a reply to message #813683] Mon, 05 March 2012 16:56 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
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/
Previous Topic:Add userinput to existing XMI
Next Topic:[Teneo] Trouble with installation
Goto Forum:
  


Current Time: Thu Mar 28 12:29:17 GMT 2024

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

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

Back to the top