You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by Ron Gavlin <rg...@yahoo.com> on 2006/07/06 18:49:22 UTC

XMLHelper.save() specifying default namespace of root element

When I invoke XMLHelper.INSTANCE.save(), I would like the ability to make the namespace I specify for the root element the default namespace for the resulting document. Currently, a namespace and prefix are defined for the root element and all nodes from that namespace are specified using that prefix. Is there any way to trigger use of a default namespace to accomplish this?
 
Also, I noticed that Jeremy has a class DOMHelperImpl in his sandbox that looks like it can be used to efficiently load/save DataObjects from/to DOM nodes. This looks like a useful utility class. Any plans to formally support this type of functionality in Tuscany SDO?
 
- Ron

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-user-help@ws.apache.org


Re: XMLHelper.save() specifying default namespace of root element

Posted by Frank Budinsky <fr...@ca.ibm.com>.
Ron,

Please open a JIRA feature request for this. I know this is starting to 
sound like a broken record :-) but if you want to see it implemented soon 
you might want to consider implementing it yourself and contributing it 
back.

Thanks,
Frank.

Ron Gavlin <rg...@yahoo.com> wrote on 07/06/2006 11:39:14 PM:

> Frank,
> 
> Thanks again for the quick response. 
> 
> This feature is important to us for the following reason. We are in 
> the process of re-architecting an existing web service to use SDO 
> instead of DOM4J. Our web service clients are expecting response 
> documents that have a default namespace. DOM4J created and 
> serialized these documents as such. When we generate the same 
> response documents using SDO, a default namespace is not used. 
> Rather, the response document root element has a prefixed namespace 
> attribute and the child elements in that namespace have prefixed 
> names. We need to reproduce the default namespace semantic so that 
> our legacy web service clients do not get confused.
> 
> - Ron
> 
> ----- Original Message ----
> From: Frank Budinsky <fr...@ca.ibm.com>
> To: tuscany-user@ws.apache.org
> Sent: Thursday, July 6, 2006 6:51:55 PM
> Subject: Re: XMLHelper.save() specifying default namespace of root 
element
> 
> Ron,
> 
> EMF lets you control the xmlns prefixes by setting the XMLNSPrefixMap of 

> the DocumentRoot, but SDO has no concept of DocumentRoot so it's hidden 
in 
> the implementation. To support this in Tuscany, a line of code like this 

> is needed in the XMLDocumentImpl ctor:
> 
> 
> ((EMap)documentRoot.eGet(extendedMetaData.
> getXMLNSPrefixMapFeature(documentRootClass))).put("", 
> rootElementURI);
> 
> It may be possible to add an option in the Tuscany implementation of the 

> XMLHelper.save() method to do this. 
> 
> How important is it to you? Does anybody else think this sounds like a 
> good feature to add?
> 
> Note that you need to be a little bit careful when using the default 
> namespace if your schema declares qualified form elements, for example.
> 
> Frank.
> 
> Ron Gavlin <rg...@yahoo.com> wrote on 07/06/2006 12:49:22 PM:
> 
> > When I invoke XMLHelper.INSTANCE.save(), I would like the ability to
> > make the namespace I specify for the root element the default 
> > namespace for the resulting document. Currently, a namespace and 
> > prefix are defined for the root element and all nodes from that 
> > namespace are specified using that prefix. Is there any way to 
> > trigger use of a default namespace to accomplish this?
> > 
> > Also, I noticed that Jeremy has a class DOMHelperImpl in his sandbox
> > that looks like it can be used to efficiently load/save DataObjects 
> > from/to DOM nodes. This looks like a useful utility class. Any plans
> > to formally support this type of functionality in Tuscany SDO?
> > 
> > - Ron
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: tuscany-user-help@ws.apache.org
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-user-help@ws.apache.org
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-user-help@ws.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-user-help@ws.apache.org


Re: XMLHelper.save() specifying default namespace of root element

Posted by Ron Gavlin <rg...@yahoo.com>.
Frank,

Thanks again for the quick response. 

This feature is important to us for the following reason. We are in the process of re-architecting an existing web service to use SDO instead of DOM4J. Our web service clients are expecting response documents that have a default namespace. DOM4J created and serialized these documents as such. When we generate the same response documents using SDO, a default namespace is not used. Rather, the response document root element has a prefixed namespace attribute and the child elements in that namespace have prefixed names. We need to reproduce the default namespace semantic so that our legacy web service clients do not get confused.

- Ron

----- Original Message ----
From: Frank Budinsky <fr...@ca.ibm.com>
To: tuscany-user@ws.apache.org
Sent: Thursday, July 6, 2006 6:51:55 PM
Subject: Re: XMLHelper.save() specifying default namespace of root element

Ron,

EMF lets you control the xmlns prefixes by setting the XMLNSPrefixMap of 
the DocumentRoot, but SDO has no concept of DocumentRoot so it's hidden in 
the implementation. To support this in Tuscany, a line of code like this 
is needed in the XMLDocumentImpl ctor:

 
((EMap)documentRoot.eGet(extendedMetaData.getXMLNSPrefixMapFeature(documentRootClass))).put("", 
rootElementURI);

It may be possible to add an option in the Tuscany implementation of the 
XMLHelper.save() method to do this. 

How important is it to you? Does anybody else think this sounds like a 
good feature to add?

Note that you need to be a little bit careful when using the default 
namespace if your schema declares qualified form elements, for example.

Frank.

Ron Gavlin <rg...@yahoo.com> wrote on 07/06/2006 12:49:22 PM:

> When I invoke XMLHelper.INSTANCE.save(), I would like the ability to
> make the namespace I specify for the root element the default 
> namespace for the resulting document. Currently, a namespace and 
> prefix are defined for the root element and all nodes from that 
> namespace are specified using that prefix. Is there any way to 
> trigger use of a default namespace to accomplish this?
> 
> Also, I noticed that Jeremy has a class DOMHelperImpl in his sandbox
> that looks like it can be used to efficiently load/save DataObjects 
> from/to DOM nodes. This looks like a useful utility class. Any plans
> to formally support this type of functionality in Tuscany SDO?
> 
> - Ron
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-user-help@ws.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-user-help@ws.apache.org





---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-user-help@ws.apache.org


Re: tuSCAny talk at BeJUG

Posted by Jim Marino <jm...@bea.com>.
I'm happy to do it if it isn't on the 24th - that's my birthday.

Jim

On Jul 13, 2006, at 8:59 AM, Jeremy Boynes wrote:

> On Jul 13, 2006, at 8:57 AM, Pete Robbins wrote:
>
>> It was the word "Java" that was putting me off ;-)
>
> One heck of a demonstration of cross-language interop :)
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: tuSCAny talk at BeJUG

Posted by Jeremy Boynes <jb...@apache.org>.
On Jul 13, 2006, at 8:57 AM, Pete Robbins wrote:

> It was the word "Java" that was putting me off ;-)

One heck of a demonstration of cross-language interop :)


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: tuSCAny talk at BeJUG

Posted by Pete Robbins <ro...@googlemail.com>.
It was the word "Java" that was putting me off ;-)

On 13/07/06, Jeremy Boynes <jb...@apache.org> wrote:
>
> Yes - BeJUG is one of the biggest and most active user groups in
> Europe (Google JavaPolis).
>
> It's probably easier if someone from Europe can go but I'm willing to
> if they can't.
> --
> Jeremy
>
> On Jul 13, 2006, at 8:50 AM, Pete Robbins wrote:
>
> > In case anyone hasn't picked this up from the usr list... I'm
> > assuming JUG
> > is Java User Group
> >
> > ---------- Forwarded message ----------
> > From: Stephan Janssen <sj...@jcs.be>
> > Date: 07-Jul-2006 16:04
> > Subject: tuSCAny talk at BeJUG
> > To: tuscany-user@ws.apache.org
> >
> > Hi,
> >
> > Is there anybody out there who would be interested in giving a one
> > hour
> > tuscany talk at our upcoming Belgian JUG "Enterprise SOA" event on
> > October 24th ?
> >
> > Kind regards,
> >
> > Stephan Janssen
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: tuscany-user-help@ws.apache.org
> >
> >
> >
> > --
> > Pete
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
>


-- 
Pete

Re: tuSCAny talk at BeJUG

Posted by Kenneth Tam <ke...@gmail.com>.
I can help with this; I'll be in Paris around that time, so
travel-wise it will be very doable.  Anyone else interested?

On 7/13/06, Jeremy Boynes <jb...@apache.org> wrote:
> Yes - BeJUG is one of the biggest and most active user groups in
> Europe (Google JavaPolis).
>
> It's probably easier if someone from Europe can go but I'm willing to
> if they can't.
> --
> Jeremy
>
> On Jul 13, 2006, at 8:50 AM, Pete Robbins wrote:
>
> > In case anyone hasn't picked this up from the usr list... I'm
> > assuming JUG
> > is Java User Group
> >
> > ---------- Forwarded message ----------
> > From: Stephan Janssen <sj...@jcs.be>
> > Date: 07-Jul-2006 16:04
> > Subject: tuSCAny talk at BeJUG
> > To: tuscany-user@ws.apache.org
> >
> > Hi,
> >
> > Is there anybody out there who would be interested in giving a one
> > hour
> > tuscany talk at our upcoming Belgian JUG "Enterprise SOA" event on
> > October 24th ?
> >
> > Kind regards,
> >
> > Stephan Janssen
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: tuscany-user-help@ws.apache.org
> >
> >
> >
> > --
> > Pete
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: tuSCAny talk at BeJUG

Posted by Jeremy Boynes <jb...@apache.org>.
Yes - BeJUG is one of the biggest and most active user groups in  
Europe (Google JavaPolis).

It's probably easier if someone from Europe can go but I'm willing to  
if they can't.
--
Jeremy

On Jul 13, 2006, at 8:50 AM, Pete Robbins wrote:

> In case anyone hasn't picked this up from the usr list... I'm  
> assuming JUG
> is Java User Group
>
> ---------- Forwarded message ----------
> From: Stephan Janssen <sj...@jcs.be>
> Date: 07-Jul-2006 16:04
> Subject: tuSCAny talk at BeJUG
> To: tuscany-user@ws.apache.org
>
> Hi,
>
> Is there anybody out there who would be interested in giving a one  
> hour
> tuscany talk at our upcoming Belgian JUG "Enterprise SOA" event on
> October 24th ?
>
> Kind regards,
>
> Stephan Janssen
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-user-help@ws.apache.org
>
>
>
> -- 
> Pete


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: tuSCAny talk at BeJUG

Posted by Jim Marino <jm...@myromatours.com>.
I may be able to but does it have to be on the 24th? It's my birthday.

Jim


On Jul 13, 2006, at 8:50 AM, Pete Robbins wrote:

> In case anyone hasn't picked this up from the usr list... I'm  
> assuming JUG
> is Java User Group
>
> ---------- Forwarded message ----------
> From: Stephan Janssen <sj...@jcs.be>
> Date: 07-Jul-2006 16:04
> Subject: tuSCAny talk at BeJUG
> To: tuscany-user@ws.apache.org
>
> Hi,
>
> Is there anybody out there who would be interested in giving a one  
> hour
> tuscany talk at our upcoming Belgian JUG "Enterprise SOA" event on
> October 24th ?
>
> Kind regards,
>
> Stephan Janssen
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-user-help@ws.apache.org
>
>
>
> -- 
> Pete


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Fwd: tuSCAny talk at BeJUG

Posted by Pete Robbins <ro...@googlemail.com>.
In case anyone hasn't picked this up from the usr list... I'm assuming JUG
is Java User Group

---------- Forwarded message ----------
From: Stephan Janssen <sj...@jcs.be>
Date: 07-Jul-2006 16:04
Subject: tuSCAny talk at BeJUG
To: tuscany-user@ws.apache.org

Hi,

Is there anybody out there who would be interested in giving a one hour
tuscany talk at our upcoming Belgian JUG "Enterprise SOA" event on
October 24th ?

Kind regards,

Stephan Janssen



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-user-help@ws.apache.org



-- 
Pete

Re: tuSCAny talk at BeJUG

Posted by kelvin goodson <ke...@gmail.com>.
I could do this, but there may be others who are closer to the SCA
development work who may be better suited for this particular event.

Regards, Kelvin.

On 7/7/06, Stephan Janssen <sj...@jcs.be> wrote:
>
> Hi,
>
> Is there anybody out there who would be interested in giving a one hour
> tuscany talk at our upcoming Belgian JUG "Enterprise SOA" event on
> October 24th ?
>
> Kind regards,
>
> Stephan Janssen
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-user-help@ws.apache.org
>
>


-- 
Best Regards
Kelvin Goodson

tuSCAny talk at BeJUG

Posted by Stephan Janssen <sj...@jcs.be>.
Hi,

Is there anybody out there who would be interested in giving a one hour
tuscany talk at our upcoming Belgian JUG "Enterprise SOA" event on  
October 24th ?

Kind regards,

Stephan Janssen



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-user-help@ws.apache.org


Re: XMLHelper.save() specifying default namespace of root element

Posted by Ron Gavlin <rg...@yahoo.com>.
Hi Frank,
 
Unfortunately, one of the child elements/DataObjects of the DataObject I'm saving has a form="unqualified". So, it needs to be serialized with a 'xmlns=""' which didn't happen. I guess this is a scoping issue with the XMLNSPrefixMap that probably cannot be easily solved, right? Do you think my best bet is to convert my DataObject to a DOM Document, set a default namespace and remove the prefix namespace on the document element, then recursively navigate through the elements and rename those within that "default namespace" to remove their prefix? Any other ideas?
 
- Ron

----- Original Message ----
From: Frank Budinsky <fr...@ca.ibm.com>
To: tuscany-user@ws.apache.org
Sent: Thursday, July 6, 2006 6:51:55 PM
Subject: Re: XMLHelper.save() specifying default namespace of root element


Ron,

EMF lets you control the xmlns prefixes by setting the XMLNSPrefixMap of 
the DocumentRoot, but SDO has no concept of DocumentRoot so it's hidden in 
the implementation. To support this in Tuscany, a line of code like this 
is needed in the XMLDocumentImpl ctor:


((EMap)documentRoot.eGet(extendedMetaData.getXMLNSPrefixMapFeature(documentRootClass))).put("", 
rootElementURI);

It may be possible to add an option in the Tuscany implementation of the 
XMLHelper.save() method to do this. 

How important is it to you? Does anybody else think this sounds like a 
good feature to add?

Note that you need to be a little bit careful when using the default 
namespace if your schema declares qualified form elements, for example.

Frank.

Ron Gavlin <rg...@yahoo.com> wrote on 07/06/2006 12:49:22 PM:

> When I invoke XMLHelper.INSTANCE.save(), I would like the ability to
> make the namespace I specify for the root element the default 
> namespace for the resulting document. Currently, a namespace and 
> prefix are defined for the root element and all nodes from that 
> namespace are specified using that prefix. Is there any way to 
> trigger use of a default namespace to accomplish this?
> 
> Also, I noticed that Jeremy has a class DOMHelperImpl in his sandbox
> that looks like it can be used to efficiently load/save DataObjects 
> from/to DOM nodes. This looks like a useful utility class. Any plans
> to formally support this type of functionality in Tuscany SDO?
> 
> - Ron
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-user-help@ws.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-user-help@ws.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-user-help@ws.apache.org


Re: XMLHelper.save() specifying default namespace of root element

Posted by Frank Budinsky <fr...@ca.ibm.com>.
Ron,

EMF lets you control the xmlns prefixes by setting the XMLNSPrefixMap of 
the DocumentRoot, but SDO has no concept of DocumentRoot so it's hidden in 
the implementation. To support this in Tuscany, a line of code like this 
is needed in the XMLDocumentImpl ctor:

 
((EMap)documentRoot.eGet(extendedMetaData.getXMLNSPrefixMapFeature(documentRootClass))).put("", 
rootElementURI);

It may be possible to add an option in the Tuscany implementation of the 
XMLHelper.save() method to do this. 

How important is it to you? Does anybody else think this sounds like a 
good feature to add?

Note that you need to be a little bit careful when using the default 
namespace if your schema declares qualified form elements, for example.

Frank.

Ron Gavlin <rg...@yahoo.com> wrote on 07/06/2006 12:49:22 PM:

> When I invoke XMLHelper.INSTANCE.save(), I would like the ability to
> make the namespace I specify for the root element the default 
> namespace for the resulting document. Currently, a namespace and 
> prefix are defined for the root element and all nodes from that 
> namespace are specified using that prefix. Is there any way to 
> trigger use of a default namespace to accomplish this?
> 
> Also, I noticed that Jeremy has a class DOMHelperImpl in his sandbox
> that looks like it can be used to efficiently load/save DataObjects 
> from/to DOM nodes. This looks like a useful utility class. Any plans
> to formally support this type of functionality in Tuscany SDO?
> 
> - Ron
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-user-help@ws.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-user-help@ws.apache.org