|
Re: Creating EMF model from XML schema - special characters - com.montages.xml.zip (0/1) [message #422924 is a reply to message #422900] |
Thu, 18 September 2008 19:25 |
Ed Merks Messages: 33141 Registered: July 2009 |
Senior Member |
|
|
Marc,
Comments below.
Marc Moser wrote:
> Hi,
>
> I have a problem with some characters when creating an EMF model from
> an XML schema. The relevant parts of the XML schema looks like this:
>
> <?xml version="1.0" encoding="UTF-8"?>
> ...
> <xsd:complexType name="Questionnaire">
> ...
> <xsd:attribute ecore:transient="true"
> ecore:derived="true" ecore:volatile="true" ecore:changeable="false"
> name="maxPoints" type="xsd:int">
> <xsd:annotation>
> <xsd:appinfo ecore:key="derive"
> source="http://www.xocl.org/OCL">self.questions->collect(q: Query |
> q.maxPoints)->sum()</xsd:appinfo>
> </xsd:annotation>
> </xsd:attribute>
> ...
> </xsd:schema>
>
> In particular, the OCL expression
>
> self.questions->collect(q: Query | q.maxPoints)->sum()
>
> gets transformed into
>
> self.questions->collect(q: Query | q.maxPoints)->sum()
>
> Now I understand that > is a special character in XML schema and that
> it is correctly escaped using > but I don't know what I have to do
> in order to end up with > in the ecore.
It should not matter. By the time you read it into memory it will be
the right character.
> I tried escaping the > with
> > in my XML schema, but then I still end up with > in the ecore.
> Anyone has an idea?
>
You shouldn't worry about what it looks like in the *.ecore file, as
long as it's the correct character once it's read in. Any XML parser
will yield the correct characters from reading >...
> Attached is simple project with the complete XML schema in it.
>
> Best,
> Marc
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03511 seconds