Ron,

I forwarded your question to Ed Merks (the top EMF guru) and here's his 
reply.

Frank.

----- Forwarded by Frank Budinsky/Toronto/IBM on 07/07/2006 10:21 AM -----

Ed Merks/Toronto/IBM
07/07/2006 10:13 AM

To
Frank Budinsky/Toronto/[EMAIL PROTECTED]
cc

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





Frank,

Yes, direct manipulation of the DOM that's produced by default is really 
the only way right now.    This is definitely a hard/expensive problem to 
solve since XMLSaveImpl is very much geared around emitting all the unique 
prefixes right at the top.  (That being said, where there's a will there's 
a way. ;-)


Ed Merks/Toronto/[EMAIL PROTECTED]
mailto: [EMAIL PROTECTED]
905-413-3265  (t/l 969)





Frank Budinsky/Toronto/IBM 
07/07/2006 09:51 AM

To
Ed Merks/Toronto/[EMAIL PROTECTED]
cc

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





Ed,

Can you answer this. I think I'm over my head now :-)

Thanks,
Frank.

----- Forwarded by Frank Budinsky/Toronto/IBM on 07/07/2006 09:51 AM -----

Ron Gavlin <[EMAIL PROTECTED]> 
07/07/2006 09:47 AM
Please respond to
[email protected]


To
[email protected]
cc

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






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 <[EMAIL PROTECTED]>
To: [email protected]
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 <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to