|
Re: Editor EMF created from XML schema produce bad code [message #416212 is a reply to message #416211] |
Tue, 22 January 2008 13:06 |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Andrea,
Normally, you shouldn't expect to get bad code generated unless there are
errors in your model (duplicate element or type names, etc.).
When you open the GenModel editor, does it show you validation problems?
Cheers,
Christian
Andrea wrote:
> I generated my edit and editor code from my XML Schema but now when I use
> the editor it produce not well formed code.
>
> It depends from my XML Schema or I have to little modify the generated
> model ?
|
|
|
Re: Editor EMF created from XML schema produce bad code [message #416213 is a reply to message #416212] |
Tue, 22 January 2008 13:24 |
Ed Merks Messages: 33137 Registered: July 2009 |
Senior Member |
|
|
This is a multi-part message in MIME format.
--------------070906050503060606010108
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Christian,
Maybe the problem was serialized content that didn't conform to the
schema. Obviously we need more details to answer the questions. Like
what's the specific problem. What does the schema look like? What does
the XML look like?
Christian W. Damus wrote:
> Hi, Andrea,
>
> Normally, you shouldn't expect to get bad code generated unless there are
> errors in your model (duplicate element or type names, etc.).
>
> When you open the GenModel editor, does it show you validation problems?
>
> Cheers,
>
> Christian
>
>
> Andrea wrote:
>
>
>> I generated my edit and editor code from my XML Schema but now when I use
>> the editor it produce not well formed code.
>>
>> It depends from my XML Schema or I have to little modify the generated
>> model ?
>>
>
>
--------------070906050503060606010108
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Christian,<br>
<br>
Maybe the problem was serialized content that didn't conform to the
schema. Obviously we need more details to answer the questions. Like
what's the specific problem. What does the schema look like? What
does the XML look like?<br>
<br>
<br>
Christian W. Damus wrote:
<blockquote cite="mid:fn4po9$ije$1@build.eclipse.org" type="cite">
<pre wrap="">Hi, Andrea,
Normally, you shouldn't expect to get bad code generated unless there are
errors in your model (duplicate element or type names, etc.).
When you open the GenModel editor, does it show you validation problems?
Cheers,
Christian
Andrea wrote:
</pre>
<blockquote type="cite">
<pre wrap="">I generated my edit and editor code from my XML Schema but now when I use
the editor it produce not well formed code.
It depends from my XML Schema or I have to little modify the generated
model ?
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
</blockquote>
<br>
</body>
</html>
--------------070906050503060606010108--
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
|
|
|
|
|
|
|
Re: Editor EMF created from XML schema produce bad code [message #416729 is a reply to message #416722] |
Thu, 14 February 2008 14:38 |
Marcelo Paternostro Messages: 602 Registered: July 2009 |
Senior Member |
|
|
Hi Andrea,
It seems that your regex is not the most appropriate again (although I
don't know what is the restriction you want to enforce). I would
suggest doing some research on regular expressions. They are extremely
helpful (the Eclipse search dialog, for example, supports them) so I can
guarantee that you wouldn't be wasting your time.
When I was studying them, I've used the following links a lot. You can
create a text file in Eclipse, type in some strings, and test the
patters as you study them.
http://www.regular-expressions.info/tutorial.html
http://java.sun.com/docs/books/tutorial/essential/regex/
The pattern you have here, "\w+dpi", matches any string that has one or
more alphanumeric characters followed by the 3 letters "dpi".
Cheers,
Marcelo
Andrea wrote:
> Thanks a lot Marcelo
> your suggestion solve my problem but I don't understand
> why also this part of schema give the same problem:
>
> <xs:simpleType name="STresolution">
> <xs:restriction base="xs:integer">
> <xs:minExclusive value="0"/>
> <xs:pattern value="\w+dpi"/>
> </xs:restriction>
> </xs:simpleType>
>
> The problem is the \d or the + ?
> Why this pattern give me always and everywhere the same error ?
|
|
|
|
Powered by
FUDForum. Page generated in 0.03946 seconds