Andrew, This would be a welcome enhancement, we are also experiencing problems related the extra namespace declarations.
Thank You, Chad E. Iverson > Wholesale Mktg & Profitability 415-477-7098 > This message may contain confidential and/or privileged information. If you > are not the addressee or authorized to receive this for the addressee, you > must not use, copy, disclose, or take any action based on this message or any > information herein. If you have received this message in error, please > advise the sender immediately by reply e-mail and delete this message. Thank > you for your cooperation. -----Original Message----- From: Andrew Fawcett [mailto:[EMAIL PROTECTED] Sent: Thursday, May 19, 2005 7:33 AM To: [email protected] Subject: RE: [castor-dev][XML] too many namespace declarations in element attributes Folks, Yes the key issue is when multiple namespaces are used. You can preload the Marshaler instance with your namespaces so that it declares them on the root node. So it doesn't have to keep declaring them over and over as they drop in and out of scope in the XML. However I understand that in generic solutions this isn't always possible to know this at coding time. So if you have generated descriptors it is possible to search through these and build up a list of namespaces that would be needed to serialise a given object graph. It can be an expensive operation so you should probably cache the results. I wouldn't be against considering this as an enhancement to Castor XML if I thought there was demand for it. Andy. -----Original Message----- From: Gregory Block [mailto:[EMAIL PROTECTED] Sent: 18 May 2005 12:14 To: [email protected]; Fredo Corleone Subject: Re: [castor-dev][XML] too many namespace declarations in element attributes On 16 May 2005, at 03:10, Fredo Corleone wrote: > Its been my observation that Castor creates xml with several > unnecessary namespace declarations when the schema includes/imports > schemas from several different files. I haven't had the time or need > to pursue this further because its not breaking anything.. I routinely do this without problems. <?xml version="1.0" encoding="UTF-8"?> <wow-feeds:article xmlns:wow-type="http://xml.whatsonwhen.com/schemas/1.0/wow- types.xsd" xmlns:wow-feeds="http://xml.whatsonwhen.com/schemas/1.0/wow- feeds.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xml.whatsonwhen.com/schemas/1.0/wow- feeds.xsd http://xml.whatsonwhen.com/schemas/1.0/wow-feeds.xsd" id="19224" ongoing="false"> <wow-type:article-date tbc="false"> <wow-type:start-date>2005-04-18T00:00:00.000+01:00</wow- type:start-date> <wow-type:end-date>2005-05-09T00:00:00.000+01:00</wow- type:end-date> </wow-type:article-date> <wow-type:article-date tbc="true"> <wow-type:start-date>2006-04-18T00:00:00.000+01:00</wow- type:start-date> <wow-type:end-date>2006-05-09T00:00:00.000+01:00</wow- type:end-date> </wow-type:article-date> <wow-type:article-date tbc="true"> <wow-type:start-date>2007-04-18T00:00:00.000+01:00</wow- type:start-date> <wow-type:end-date>2007-05-09T00:00:00.000+01:00</wow- type:end-date> </wow-type:article-date> <wow-type:title>Buenos Aires Book Fair</wow-type:title> <wow-type:summary>The Buenos Aires Book Fair is eagerly awaited every year by bibliophiles in the Argentine capital. More than a million people head for this three-week event at the La Rural exhibition complex.</wow-type:summary> .. All castor-generated XML, no mess, no fuss. The information in this message is confidential and may be legally privileged. It may not be disclosed to, or used by, anyone other than the addressee. If you receive this message in error, please advise us immediately. Internet emails are not necessarily secure. CODA does not accept responsibility for changes to any email which occur after the email has been sent. Attachments to this email may contain software viruses, which could damage your systems. CODA has checked the attachments for viruses before sending, but you should virus-check them before opening.

