Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc) » Teneo support for QName
Teneo support for QName [message #97463] |
Tue, 25 September 2007 17:03  |
Eclipse User |
|
|
|
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 #98457 is a reply to message #98391] |
Thu, 04 October 2007 12: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 13:17   |
Eclipse User |
|
|
|
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 #609818 is a reply to message #97463] |
Wed, 26 September 2007 03:49  |
Eclipse User |
|
|
|
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 02:43  |
Eclipse User |
|
|
|
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 03:16  |
Eclipse User |
|
|
|
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 12:57  |
Eclipse User |
|
|
|
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 #609888 is a reply to message #98457] |
Thu, 04 October 2007 13:17  |
Eclipse User |
|
|
|
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 Jul 13 00:23:03 EDT 2025
Powered by FUDForum. Page generated in 0.06744 seconds
|