Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc) » Teneo support for QName
| | | |
Re: Teneo support for QName [message #98457 is a reply to message #98391] |
Thu, 04 October 2007 16:57 |
Eclipse User |
|
|
|
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 |
Martin Taal 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 #609886 is a reply to message #98391] |
Thu, 04 October 2007 16:57 |
Ed Merks Messages: 33216 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 |
Martin Taal 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
|
|
| | | |
Goto Forum:
Current Time: Sun Sep 22 01:12:07 GMT 2024
Powered by FUDForum. Page generated in 0.04984 seconds
|