|
Re: Special Characters (< and &) in names breaks parser [message #477636 is a reply to message #477635] |
Sat, 26 July 2008 08:35 |
Rafael Chaves 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=">&<"" 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 |
Rafael Chaves 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=">&<"" visibility="public" class="_CN-BclrsEd2FZqWlQqCSgg"/>
</packagedElement>
</uml:Package>
--------------060404010404070406050100--
|
|
|
Powered by
FUDForum. Page generated in 0.03176 seconds