Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Teneo support for QName
Teneo support for QName [message #97463] Tue, 25 September 2007 21:03 Go to next message
Julia is currently offline JuliaFriend
Messages: 85
Registered: July 2009
Member
Hi Martin,

I asked about QName in a previous posting, but it seem to have disappeared
from the newsgroup as it was an older posting.

Is there any chance that Teneo will support QName in it's schema
transformation? My xsd will convert to a schema without error if I change
my element to use string instead of Qname. But QName is not really just a
string. We are following a common specification in our development that
requires us to use QName. We can't use "string"

Here's an example of what the xml may look like:
<events:name
xmlns:x="http://com.bookstore.org/pages">x:switchPage</events:name>

Where xmlns:x="http://com.bookstore.org/pages" and x:switchPage would
probably need to be stored in database or something like this.

Is there around this?

Julia
Re: Teneo support for QName [message #97503 is a reply to message #97463] Wed, 26 September 2007 07:49 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Julia,
Here is the old post:
http://dev.eclipse.org/newslists/news.eclipse.technology.emf t/msg02938.html

When you look at it at runtime what type of objects are used for QName, is it a String or another type?

If you have a small example (xsd plus small xml with testdata) then I can use this to solve this.

Based on this I can change the mapping logic so that Teneo will create a more precise mapping.

gr. Martin

Julia wrote:
> Hi Martin,
>
> I asked about QName in a previous posting, but it seem to have
> disappeared from the newsgroup as it was an older posting.
>
> Is there any chance that Teneo will support QName in it's schema
> transformation? My xsd will convert to a schema without error if I
> change my element to use string instead of Qname. But QName is not
> really just a string. We are following a common specification in our
> development that requires us to use QName. We can't use "string"
>
> Here's an example of what the xml may look like:
> <events:name
> xmlns:x="http://com.bookstore.org/pages">x:switchPage</events:name>
>
> Where xmlns:x="http://com.bookstore.org/pages" and x:switchPage would
> probably need to be stored in database or something like this.
>
> Is there around this?
>
> Julia
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: Teneo support for QName [message #98376 is a reply to message #97503] Thu, 04 October 2007 06:43 Go to previous messageGo to next message
Julia is currently offline JuliaFriend
Messages: 85
Registered: July 2009
Member
Hi Martin,

I'm not sure what you mean by what object QName is. The jdk docs
( http://ws.apache.org/commons/ws-commons-java5/apidocs/javax/ xml/namespace/QName.html)
show that you can extract QName as a string of different parts.

Julia




<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="test.xsd"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
version="x.x.x.x"
xml:lang="en"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
xmlns:test="test.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xlink="http://www.w3.org/1999/xlink">

<xs:element name="atest" type="test:mytest"/>
<xs:complexType name="mytest">
<xs:sequence>
<xs:element name="description" type="xs:string" />
<xs:element name="name" type="xs:QName" />
</xs:sequence>
</xs:complexType>

</schema>


Sample 1
-----------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<test:atest xmlns:test="test.xsd">
<test:mytest>
<test:description>mytestsample</test:description>
<test:name xmlns:x="http://com.bookstore.org">x:pages</test:name>
</test:mytest>
</test:atest>

Sample 2
------------------------------------------------------------ -
<?xml version="1.0" encoding="UTF-8"?>
<test:atest xmlns:test="test.xsd" xmlns:xx="http://ca.chapters.books">
<test:mytest>
<test:description>mytestsample2</test:description>
<test:name>xx:livres</test:name>
</test:mytest>
</test:atest>
Re: Teneo support for QName [message #98391 is a reply to message #98376] Thu, 04 October 2007 07:16 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Julia,
What I mean is when you load an xml/xmi document using an emf resource what class/object does EMF
then use to set this efeature (is it the javax.xml.namespace.QName you mention below)?

gr. Martin

Julia wrote:
> Hi Martin,
>
> I'm not sure what you mean by what object QName is. The jdk docs
> ( http://ws.apache.org/commons/ws-commons-java5/apidocs/javax/ xml/namespace/QName.html)
> show that you can extract QName as a string of different parts.
>
> Julia
>
>
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema targetNamespace="test.xsd"
> elementFormDefault="qualified"
> attributeFormDefault="unqualified"
> version="x.x.x.x"
> xml:lang="en"
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
> xmlns:test="test.xsd"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns:xlink="http://www.w3.org/1999/xlink">
>
> <xs:element name="atest" type="test:mytest"/>
> <xs:complexType name="mytest">
> <xs:sequence>
> <xs:element name="description" type="xs:string" />
> <xs:element name="name" type="xs:QName" />
> </xs:sequence>
> </xs:complexType>
>
> </schema>
>
>
> Sample 1
> -----------------------------------------------------------
> <?xml version="1.0" encoding="UTF-8"?>
> <test:atest xmlns:test="test.xsd">
> <test:mytest>
> <test:description>mytestsample</test:description>
> <test:name xmlns:x="http://com.bookstore.org">x:pages</test:name>
> </test:mytest>
> </test:atest>
>
> Sample 2
> ------------------------------------------------------------ -
> <?xml version="1.0" encoding="UTF-8"?>
> <test:atest xmlns:test="test.xsd" xmlns:xx="http://ca.chapters.books">
> <test:mytest>
> <test:description>mytestsample2</test:description>
> <test:name>xx:livres</test:name>
> </test:mytest>
> </test:atest>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: Teneo support for QName [message #98457 is a reply to message #98391] Thu, 04 October 2007 16:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

This is a multi-part message in MIME format.
--------------060204020609060703090402
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Martin,

EMF will generally uses org.eclipse.emf.ecore.xml.type.internal.QName to
construct an instance corresponding to a QName value. In EMF 2.3, this
implementation extends the native QName implementation from the JDK
available only for Java 5.0 and higher:

public final class QName extends javax.xml.namespace.QName
{

In 2.2, it does not extend anything. As the package name implies,
this class is internal and generally should not be used outside of the
EMF implementation. XMLTypeUtil provides accessor methods for
inspecting QName instances. In EMF 2.2, such instances were surfaced in
the API as java.lang.Object since we anticipated switching to the javax
version in the future. Now its surfaced as javax.xml.Qname.

Unfortunately QName itself is immutable and our implementation relied on
being able to set the prefix during serialization (when the mapping to
the namespace is used to deduce the right prefix). So our internal
implementation still provides that support. But minus that caveat,
clients can generally just use Java QName instances...


Martin Taal wrote:
> Hi Julia,
> What I mean is when you load an xml/xmi document using an emf resource
> what class/object does EMF then use to set this efeature (is it the
> javax.xml.namespace.QName you mention below)?
>
> gr. Martin
>
> Julia wrote:
>> Hi Martin,
>>
>> I'm not sure what you mean by what object QName is. The jdk docs
>> ( http://ws.apache.org/commons/ws-commons-java5/apidocs/javax/ xml/namespace/QName.html)
>> show that you can extract QName as a string of different parts.
>>
>> Julia
>>
>>
>>
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <xs:schema targetNamespace="test.xsd"
>> elementFormDefault="qualified"
>> attributeFormDefault="unqualified"
>> version="x.x.x.x"
>> xml:lang="en"
>> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
>> xmlns:test="test.xsd"
>> xmlns:xs="http://www.w3.org/2001/XMLSchema"
>> xmlns:xlink="http://www.w3.org/1999/xlink">
>>
>> <xs:element name="atest" type="test:mytest"/>
>> <xs:complexType name="mytest">
>> <xs:sequence>
>> <xs:element name="description" type="xs:string" />
>> <xs:element name="name" type="xs:QName" />
>> </xs:sequence>
>> </xs:complexType>
>>
>> </schema>
>>
>>
>> Sample 1
>> -----------------------------------------------------------
>> <?xml version="1.0" encoding="UTF-8"?>
>> <test:atest xmlns:test="test.xsd">
>> <test:mytest>
>> <test:description>mytestsample</test:description>
>> <test:name xmlns:x="http://com.bookstore.org">x:pages</test:name>
>> </test:mytest>
>> </test:atest>
>>
>> Sample 2
>> ------------------------------------------------------------ -
>> <?xml version="1.0" encoding="UTF-8"?>
>> <test:atest xmlns:test="test.xsd" xmlns:xx="http://ca.chapters.books">
>> <test:mytest>
>> <test:description>mytestsample2</test:description>
>> <test:name>xx:livres</test:name>
>> </test:mytest>
>> </test:atest>
>>
>
>


--------------060204020609060703090402
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Martin,<br>
<br>
EMF will generally uses org.eclipse.emf.ecore.xml.type.internal.QName
to construct an instance corresponding to a QName value.
Re: Teneo support for QName [message #98472 is a reply to message #98457] Thu, 04 October 2007 17:17 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Ed, thanks,

To solve this I probably need to make a specific mapping to jpox for Qname.

Julia, are you using EMF 2.2 or EMF 2.3?

gr. Martin

Ed Merks wrote:
> Martin,
>
> EMF will generally uses org.eclipse.emf.ecore.xml.type.internal.QName to
> construct an instance corresponding to a QName value. In EMF 2.3, this
> implementation extends the native QName implementation from the JDK
> available only for Java 5.0 and higher:
>
> public final class QName extends javax.xml.namespace.QName
> {
>
> In 2.2, it does not extend anything. As the package name implies,
> this class is internal and generally should not be used outside of the
> EMF implementation. XMLTypeUtil provides accessor methods for
> inspecting QName instances. In EMF 2.2, such instances were surfaced in
> the API as java.lang.Object since we anticipated switching to the javax
> version in the future. Now its surfaced as javax.xml.Qname.
>
> Unfortunately QName itself is immutable and our implementation relied on
> being able to set the prefix during serialization (when the mapping to
> the namespace is used to deduce the right prefix). So our internal
> implementation still provides that support. But minus that caveat,
> clients can generally just use Java QName instances...
>
>
> Martin Taal wrote:
>> Hi Julia,
>> What I mean is when you load an xml/xmi document using an emf resource
>> what class/object does EMF then use to set this efeature (is it the
>> javax.xml.namespace.QName you mention below)?
>>
>> gr. Martin
>>
>> Julia wrote:
>>> Hi Martin,
>>>
>>> I'm not sure what you mean by what object QName is. The jdk docs
>>> ( http://ws.apache.org/commons/ws-commons-java5/apidocs/javax/ xml/namespace/QName.html)
>>> show that you can extract QName as a string of different parts.
>>>
>>> Julia
>>>
>>>
>>>
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <xs:schema targetNamespace="test.xsd"
>>> elementFormDefault="qualified"
>>> attributeFormDefault="unqualified"
>>> version="x.x.x.x"
>>> xml:lang="en"
>>> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
>>> xmlns:test="test.xsd"
>>> xmlns:xs="http://www.w3.org/2001/XMLSchema"
>>> xmlns:xlink="http://www.w3.org/1999/xlink">
>>>
>>> <xs:element name="atest" type="test:mytest"/>
>>> <xs:complexType name="mytest">
>>> <xs:sequence>
>>> <xs:element name="description" type="xs:string" />
>>> <xs:element name="name" type="xs:QName" />
>>> </xs:sequence>
>>> </xs:complexType>
>>>
>>> </schema>
>>>
>>>
>>> Sample 1
>>> -----------------------------------------------------------
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <test:atest xmlns:test="test.xsd">
>>> <test:mytest>
>>> <test:description>mytestsample</test:description>
>>> <test:name xmlns:x="http://com.bookstore.org">x:pages</test:name>
>>> </test:mytest>
>>> </test:atest>
>>>
>>> Sample 2
>>> ------------------------------------------------------------ -
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <test:atest xmlns:test="test.xsd" xmlns:xx="http://ca.chapters.books">
>>> <test:mytest>
>>> <test:description>mytestsample2</test:description>
>>> <test:name>xx:livres</test:name>
>>> </test:mytest>
>>> </test:atest>
>>>
>>
>>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: Teneo support for QName [message #98833 is a reply to message #98472] Tue, 09 October 2007 19:47 Go to previous messageGo to next message
Julia is currently offline JuliaFriend
Messages: 85
Registered: July 2009
Member
Hi Martin,

We are using EMF 2.2.1

Julia
Re: Teneo support for QName [message #98929 is a reply to message #98833] Wed, 10 October 2007 17:42 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Julia,
Okay, you can enter a bugzilla for this but it may take a while before I have time to look at it.

So it is probably quicker to solve it yourselve:
To solve this you would have to create your own jpox type mapping class:
http://www.jpox.org/docs/1_1/extensions/usertypes.html

and then add the field-type attribute in the jdo file in the locations were the qname is used:
http://www.jpox.org/docs/1_1/metadata_reference.html#field

gr. Martin

Julia wrote:
> Hi Martin,
>
> We are using EMF 2.2.1
>
> Julia
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: Teneo support for QName [message #99092 is a reply to message #98929] Fri, 12 October 2007 23:11 Go to previous message
Julia is currently offline JuliaFriend
Messages: 85
Registered: July 2009
Member
Hi Martin,

Ok it's bug #206215. I'll give your workaround suggestion a try. Thanks!

Julia
Re: Teneo support for QName [message #609818 is a reply to message #97463] Wed, 26 September 2007 07:49 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Julia,
Here is the old post:
http://dev.eclipse.org/newslists/news.eclipse.technology.emf t/msg02938.html

When you look at it at runtime what type of objects are used for QName, is it a String or another type?

If you have a small example (xsd plus small xml with testdata) then I can use this to solve this.

Based on this I can change the mapping logic so that Teneo will create a more precise mapping.

gr. Martin

Julia wrote:
> Hi Martin,
>
> I asked about QName in a previous posting, but it seem to have
> disappeared from the newsgroup as it was an older posting.
>
> Is there any chance that Teneo will support QName in it's schema
> transformation? My xsd will convert to a schema without error if I
> change my element to use string instead of Qname. But QName is not
> really just a string. We are following a common specification in our
> development that requires us to use QName. We can't use "string"
>
> Here's an example of what the xml may look like:
> <events:name
> xmlns:x="http://com.bookstore.org/pages">x:switchPage</events:name>
>
> Where xmlns:x="http://com.bookstore.org/pages" and x:switchPage would
> probably need to be stored in database or something like this.
>
> Is there around this?
>
> Julia
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: Teneo support for QName [message #609876 is a reply to message #97503] Thu, 04 October 2007 06:43 Go to previous message
Julia is currently offline JuliaFriend
Messages: 85
Registered: July 2009
Member
Hi Martin,

I'm not sure what you mean by what object QName is. The jdk docs
( http://ws.apache.org/commons/ws-commons-java5/apidocs/javax/ xml/namespace/QName.html)
show that you can extract QName as a string of different parts.

Julia




<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="test.xsd"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
version="x.x.x.x"
xml:lang="en"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
xmlns:test="test.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xlink="http://www.w3.org/1999/xlink">

<xs:element name="atest" type="test:mytest"/>
<xs:complexType name="mytest">
<xs:sequence>
<xs:element name="description" type="xs:string" />
<xs:element name="name" type="xs:QName" />
</xs:sequence>
</xs:complexType>

</schema>


Sample 1
-----------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<test:atest xmlns:test="test.xsd">
<test:mytest>
<test:description>mytestsample</test:description>
<test:name xmlns:x="http://com.bookstore.org">x:pages</test:name>
</test:mytest>
</test:atest>

Sample 2
------------------------------------------------------------ -
<?xml version="1.0" encoding="UTF-8"?>
<test:atest xmlns:test="test.xsd" xmlns:xx="http://ca.chapters.books">
<test:mytest>
<test:description>mytestsample2</test:description>
<test:name>xx:livres</test:name>
</test:mytest>
</test:atest>
Re: Teneo support for QName [message #609877 is a reply to message #98376] Thu, 04 October 2007 07:16 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Julia,
What I mean is when you load an xml/xmi document using an emf resource what class/object does EMF
then use to set this efeature (is it the javax.xml.namespace.QName you mention below)?

gr. Martin

Julia wrote:
> Hi Martin,
>
> I'm not sure what you mean by what object QName is. The jdk docs
> ( http://ws.apache.org/commons/ws-commons-java5/apidocs/javax/ xml/namespace/QName.html)
> show that you can extract QName as a string of different parts.
>
> Julia
>
>
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema targetNamespace="test.xsd"
> elementFormDefault="qualified"
> attributeFormDefault="unqualified"
> version="x.x.x.x"
> xml:lang="en"
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
> xmlns:test="test.xsd"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns:xlink="http://www.w3.org/1999/xlink">
>
> <xs:element name="atest" type="test:mytest"/>
> <xs:complexType name="mytest">
> <xs:sequence>
> <xs:element name="description" type="xs:string" />
> <xs:element name="name" type="xs:QName" />
> </xs:sequence>
> </xs:complexType>
>
> </schema>
>
>
> Sample 1
> -----------------------------------------------------------
> <?xml version="1.0" encoding="UTF-8"?>
> <test:atest xmlns:test="test.xsd">
> <test:mytest>
> <test:description>mytestsample</test:description>
> <test:name xmlns:x="http://com.bookstore.org">x:pages</test:name>
> </test:mytest>
> </test:atest>
>
> Sample 2
> ------------------------------------------------------------ -
> <?xml version="1.0" encoding="UTF-8"?>
> <test:atest xmlns:test="test.xsd" xmlns:xx="http://ca.chapters.books">
> <test:mytest>
> <test:description>mytestsample2</test:description>
> <test:name>xx:livres</test:name>
> </test:mytest>
> </test:atest>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: Teneo support for QName [message #609886 is a reply to message #98391] Thu, 04 October 2007 16:57 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33188
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------060204020609060703090402
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Martin,

EMF will generally uses org.eclipse.emf.ecore.xml.type.internal.QName to
construct an instance corresponding to a QName value. In EMF 2.3, this
implementation extends the native QName implementation from the JDK
available only for Java 5.0 and higher:

public final class QName extends javax.xml.namespace.QName
{

In 2.2, it does not extend anything. As the package name implies,
this class is internal and generally should not be used outside of the
EMF implementation. XMLTypeUtil provides accessor methods for
inspecting QName instances. In EMF 2.2, such instances were surfaced in
the API as java.lang.Object since we anticipated switching to the javax
version in the future. Now its surfaced as javax.xml.Qname.

Unfortunately QName itself is immutable and our implementation relied on
being able to set the prefix during serialization (when the mapping to
the namespace is used to deduce the right prefix). So our internal
implementation still provides that support. But minus that caveat,
clients can generally just use Java QName instances...


Martin Taal wrote:
> Hi Julia,
> What I mean is when you load an xml/xmi document using an emf resource
> what class/object does EMF then use to set this efeature (is it the
> javax.xml.namespace.QName you mention below)?
>
> gr. Martin
>
> Julia wrote:
>> Hi Martin,
>>
>> I'm not sure what you mean by what object QName is. The jdk docs
>> ( http://ws.apache.org/commons/ws-commons-java5/apidocs/javax/ xml/namespace/QName.html)
>> show that you can extract QName as a string of different parts.
>>
>> Julia
>>
>>
>>
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <xs:schema targetNamespace="test.xsd"
>> elementFormDefault="qualified"
>> attributeFormDefault="unqualified"
>> version="x.x.x.x"
>> xml:lang="en"
>> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
>> xmlns:test="test.xsd"
>> xmlns:xs="http://www.w3.org/2001/XMLSchema"
>> xmlns:xlink="http://www.w3.org/1999/xlink">
>>
>> <xs:element name="atest" type="test:mytest"/>
>> <xs:complexType name="mytest">
>> <xs:sequence>
>> <xs:element name="description" type="xs:string" />
>> <xs:element name="name" type="xs:QName" />
>> </xs:sequence>
>> </xs:complexType>
>>
>> </schema>
>>
>>
>> Sample 1
>> -----------------------------------------------------------
>> <?xml version="1.0" encoding="UTF-8"?>
>> <test:atest xmlns:test="test.xsd">
>> <test:mytest>
>> <test:description>mytestsample</test:description>
>> <test:name xmlns:x="http://com.bookstore.org">x:pages</test:name>
>> </test:mytest>
>> </test:atest>
>>
>> Sample 2
>> ------------------------------------------------------------ -
>> <?xml version="1.0" encoding="UTF-8"?>
>> <test:atest xmlns:test="test.xsd" xmlns:xx="http://ca.chapters.books">
>> <test:mytest>
>> <test:description>mytestsample2</test:description>
>> <test:name>xx:livres</test:name>
>> </test:mytest>
>> </test:atest>
>>
>
>


--------------060204020609060703090402
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Martin,<br>
<br>
EMF will generally uses org.eclipse.emf.ecore.xml.type.internal.QName
to construct an instance corresponding to a QName value.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Teneo support for QName [message #609888 is a reply to message #98457] Thu, 04 October 2007 17:17 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Ed, thanks,

To solve this I probably need to make a specific mapping to jpox for Qname.

Julia, are you using EMF 2.2 or EMF 2.3?

gr. Martin

Ed Merks wrote:
> Martin,
>
> EMF will generally uses org.eclipse.emf.ecore.xml.type.internal.QName to
> construct an instance corresponding to a QName value. In EMF 2.3, this
> implementation extends the native QName implementation from the JDK
> available only for Java 5.0 and higher:
>
> public final class QName extends javax.xml.namespace.QName
> {
>
> In 2.2, it does not extend anything. As the package name implies,
> this class is internal and generally should not be used outside of the
> EMF implementation. XMLTypeUtil provides accessor methods for
> inspecting QName instances. In EMF 2.2, such instances were surfaced in
> the API as java.lang.Object since we anticipated switching to the javax
> version in the future. Now its surfaced as javax.xml.Qname.
>
> Unfortunately QName itself is immutable and our implementation relied on
> being able to set the prefix during serialization (when the mapping to
> the namespace is used to deduce the right prefix). So our internal
> implementation still provides that support. But minus that caveat,
> clients can generally just use Java QName instances...
>
>
> Martin Taal wrote:
>> Hi Julia,
>> What I mean is when you load an xml/xmi document using an emf resource
>> what class/object does EMF then use to set this efeature (is it the
>> javax.xml.namespace.QName you mention below)?
>>
>> gr. Martin
>>
>> Julia wrote:
>>> Hi Martin,
>>>
>>> I'm not sure what you mean by what object QName is. The jdk docs
>>> ( http://ws.apache.org/commons/ws-commons-java5/apidocs/javax/ xml/namespace/QName.html)
>>> show that you can extract QName as a string of different parts.
>>>
>>> Julia
>>>
>>>
>>>
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <xs:schema targetNamespace="test.xsd"
>>> elementFormDefault="qualified"
>>> attributeFormDefault="unqualified"
>>> version="x.x.x.x"
>>> xml:lang="en"
>>> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
>>> xmlns:test="test.xsd"
>>> xmlns:xs="http://www.w3.org/2001/XMLSchema"
>>> xmlns:xlink="http://www.w3.org/1999/xlink">
>>>
>>> <xs:element name="atest" type="test:mytest"/>
>>> <xs:complexType name="mytest">
>>> <xs:sequence>
>>> <xs:element name="description" type="xs:string" />
>>> <xs:element name="name" type="xs:QName" />
>>> </xs:sequence>
>>> </xs:complexType>
>>>
>>> </schema>
>>>
>>>
>>> Sample 1
>>> -----------------------------------------------------------
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <test:atest xmlns:test="test.xsd">
>>> <test:mytest>
>>> <test:description>mytestsample</test:description>
>>> <test:name xmlns:x="http://com.bookstore.org">x:pages</test:name>
>>> </test:mytest>
>>> </test:atest>
>>>
>>> Sample 2
>>> ------------------------------------------------------------ -
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <test:atest xmlns:test="test.xsd" xmlns:xx="http://ca.chapters.books">
>>> <test:mytest>
>>> <test:description>mytestsample2</test:description>
>>> <test:name>xx:livres</test:name>
>>> </test:mytest>
>>> </test:atest>
>>>
>>
>>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: Teneo support for QName [message #609954 is a reply to message #98472] Tue, 09 October 2007 19:47 Go to previous message
Julia is currently offline JuliaFriend
Messages: 85
Registered: July 2009
Member
Hi Martin,

We are using EMF 2.2.1

Julia
Re: Teneo support for QName [message #609972 is a reply to message #98833] Wed, 10 October 2007 17:42 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Julia,
Okay, you can enter a bugzilla for this but it may take a while before I have time to look at it.

So it is probably quicker to solve it yourselve:
To solve this you would have to create your own jpox type mapping class:
http://www.jpox.org/docs/1_1/extensions/usertypes.html

and then add the field-type attribute in the jdo file in the locations were the qname is used:
http://www.jpox.org/docs/1_1/metadata_reference.html#field

gr. Martin

Julia wrote:
> Hi Martin,
>
> We are using EMF 2.2.1
>
> Julia
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: Teneo support for QName [message #609999 is a reply to message #98929] Fri, 12 October 2007 23:11 Go to previous message
Julia is currently offline JuliaFriend
Messages: 85
Registered: July 2009
Member
Hi Martin,

Ok it's bug #206215. I'll give your workaround suggestion a try. Thanks!

Julia
Previous Topic:Using EMF Compare together with svn
Next Topic:Clean EMF install: Project does not exist?
Goto Forum:
  


Current Time: Sat Jul 27 05:48:59 GMT 2024

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

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

Back to the top