Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Special Characters (< and &) in names breaks parser
Special Characters (< and &) in names breaks parser [message #477635] Sat, 26 July 2008 05:42 Go to next message
Markus Voelter is currently offline Markus VoelterFriend
Messages: 33
Registered: July 2009
Member
Hi,

I am reading a UML2 XMI model that contains < and &
in the names of UML model elements (it is a C++ model
and it contains, for example, an operator< method).

When trying to read this via the Eclipse UML tooling,
the parser dies and says something about illegal char-
acters. The same is true for the & in names (like in
C++ reference attributes).

Any idea what I can do?

Thanks,
Markus

--
Markus Völter

voelter - ingenieurbüro für softwaretechnologie
Grabenstrasse 4, 73033 Goeppingen, Germany
Tel. +49 (0) 171 / 86 01 869
Email: voelter@acm.org

Web: http://www.voelter.de
Blog: http://www.voelter.de/blog
Podcast: http://www.se-radio.net

PGP Public Key: http://www.voelter.de/data/MarkusVoelter.gpg
Re: Special Characters (< and &) in names breaks parser [message #477636 is a reply to message #477635] Sat, 26 July 2008 08:35 Go to previous message
Rafael Chaves is currently offline Rafael ChavesFriend
Messages: 362
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------060404010404070406050100
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

I was just going to say that probably those characters were not properly
encoded as they should given that they are XML predefined entities, but
then I just tried to open both a .xmi file and a .uml having "<", "&"
and ">" in operation names and they opened just fine (see attachment),
regardless those characters where encoded as entities or not, I guess
because they appear in attributes, not as nodes.

Can you provide an example of a model that you can't load?

Cheers,

Rafael

Markus Voelter wrote:
> Hi,
>
> I am reading a UML2 XMI model that contains < and &
> in the names of UML model elements (it is a C++ model
> and it contains, for example, an operator< method).
>
> When trying to read this via the Eclipse UML tooling,
> the parser dies and says something about illegal char-
> acters. The same is true for the & in names (like in
> C++ reference attributes).
>
> Any idea what I can do?
>
> Thanks,
> Markus
>


--------------060404010404070406050100
Content-Type: text/xml;
name="test.uml"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="test.uml"

<?xml version="1.0" encoding="UTF-8"?>
<uml:Package xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1" xmlns:uml="http://www.eclipse.org/uml2/2.1.0/UML" xmi:id="_tTL0IFrsEd2FZqWlQqCSgg" name="test">
<eAnnotations xmi:id="_tTL0IVrsEd2FZqWlQqCSgg" source="com.abstratt/mdd/"/>
<packagedElement xmi:type="uml:Class" xmi:id="_tTL0IlrsEd2FZqWlQqCSgg" name="A">
<ownedOperation xmi:id="_tTL0I1rsEd2FZqWlQqCSgg" name=">" visibility="public"/>
</packagedElement>
</uml:Package>

--------------060404010404070406050100
Content-Type: text/xml;
name="test.xmi"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="test.xmi"

<?xml version="1.0" encoding="UTF-8"?>
<uml:Package xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://schema.omg.org/spec/UML/2.1.1" xsi:schemaLocation="http://schema.omg.org/spec/UML/2.1.1 http://www.eclipse.org/uml2/2.1.0/UML" xmi:id="_CN-BcFrsEd2FZqWlQqCSgg" name="test">
<xmi:Extension extender="http://www.eclipse.org/emf/2002/Ecore">
<eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_CN-BcVrsEd2FZqWlQqCSgg" source="com.abstratt/mdd/"/>
</xmi:Extension>
<packagedElement xmi:type="uml:Class" xmi:id="_CN-BclrsEd2FZqWlQqCSgg" name="A">
<ownedOperation xmi:type="uml:Operation" xmi:id="_CN-Bc1rsEd2FZqWlQqCSgg" name=">&amp;&lt;&quot;" visibility="public" class="_CN-BclrsEd2FZqWlQqCSgg"/>
</packagedElement>
</uml:Package>

--------------060404010404070406050100--
Re: Special Characters (< and &) in names breaks parser [message #626827 is a reply to message #477635] Sat, 26 July 2008 08:35 Go to previous message
Rafael Chaves is currently offline Rafael ChavesFriend
Messages: 362
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------060404010404070406050100
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

I was just going to say that probably those characters were not properly
encoded as they should given that they are XML predefined entities, but
then I just tried to open both a .xmi file and a .uml having "<", "&"
and ">" in operation names and they opened just fine (see attachment),
regardless those characters where encoded as entities or not, I guess
because they appear in attributes, not as nodes.

Can you provide an example of a model that you can't load?

Cheers,

Rafael

Markus Voelter wrote:
> Hi,
>
> I am reading a UML2 XMI model that contains < and &
> in the names of UML model elements (it is a C++ model
> and it contains, for example, an operator< method).
>
> When trying to read this via the Eclipse UML tooling,
> the parser dies and says something about illegal char-
> acters. The same is true for the & in names (like in
> C++ reference attributes).
>
> Any idea what I can do?
>
> Thanks,
> Markus
>


--------------060404010404070406050100
Content-Type: text/xml;
name="test.uml"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="test.uml"

<?xml version="1.0" encoding="UTF-8"?>
<uml:Package xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1" xmlns:uml="http://www.eclipse.org/uml2/2.1.0/UML" xmi:id="_tTL0IFrsEd2FZqWlQqCSgg" name="test">
<eAnnotations xmi:id="_tTL0IVrsEd2FZqWlQqCSgg" source="com.abstratt/mdd/"/>
<packagedElement xmi:type="uml:Class" xmi:id="_tTL0IlrsEd2FZqWlQqCSgg" name="A">
<ownedOperation xmi:id="_tTL0I1rsEd2FZqWlQqCSgg" name=">" visibility="public"/>
</packagedElement>
</uml:Package>

--------------060404010404070406050100
Content-Type: text/xml;
name="test.xmi"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="test.xmi"

<?xml version="1.0" encoding="UTF-8"?>
<uml:Package xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://schema.omg.org/spec/UML/2.1.1" xsi:schemaLocation="http://schema.omg.org/spec/UML/2.1.1 http://www.eclipse.org/uml2/2.1.0/UML" xmi:id="_CN-BcFrsEd2FZqWlQqCSgg" name="test">
<xmi:Extension extender="http://www.eclipse.org/emf/2002/Ecore">
<eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_CN-BcVrsEd2FZqWlQqCSgg" source="com.abstratt/mdd/"/>
</xmi:Extension>
<packagedElement xmi:type="uml:Class" xmi:id="_CN-BclrsEd2FZqWlQqCSgg" name="A">
<ownedOperation xmi:type="uml:Operation" xmi:id="_CN-Bc1rsEd2FZqWlQqCSgg" name=">&amp;&lt;&quot;" visibility="public" class="_CN-BclrsEd2FZqWlQqCSgg"/>
</packagedElement>
</uml:Package>

--------------060404010404070406050100--
Previous Topic:Special Characters (< and &) in names breaks parser
Next Topic:Instrumenting field class on Operation?
Goto Forum:
  


Current Time: Thu Apr 25 16:01:14 GMT 2024

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

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

Back to the top