David, I am sorry, I still don't understand.
I agree with you that documents without namespaces should be supported and as far as I know they are supported fully in XMLBeans. Which is why I have to ask: 1. What do you mean by "XMLBeans complained about the well-formed XML unless there was a default namespace declaration"? I can see XMLBeans not being able to map a no-namespace document to your namespace-aware classes generated from a namespace-aware Schema, but I am curious as to what the complaint was. 2. I think you are right that XMLBeans "locks" the namespace in the generated artifacts to be the one in the Schema, but what else could it do? That namespace is part of the name of the types and elements and is supposed to disambiguate in case you have multiple declarations for an element with the same local name. 3. What do you mean by "well-formed XML should be allowed to define the namespace without the URL for the declaration having any special significance"? Well-formed XML is allowed to define any namespaces it wants, but those namespaces, if any, will be used to match against the Schema declaration (which is how it's supposed to be used). XMLBeans is not using it as an unofficial version marker at all. 4. People should be able to change the URL in their documents to be their own URL, but it nowhere says that they should then still be able to validate their documents against your Schema. I would be very interested to see an example XML and what the expected behaviour would be. So far, my understanding is still that what you would need is the ability to replace ANY namespace URI in the incoming document with your own URI, and I still find it pretty strange. Radu On Mon, 2006-11-20 at 08:45 -0500, Webber, David (NIH/OD) [C] wrote: > Radu, > > > > No – that’s not the idea. > > > > All I was trying to do was use a simple piece of well-formed XML > without any namespace prefixes in it!!! > > > > This appears to be one of those situations where the Java > implementation stack (Saxon, ‘Beans, et al) default behaviour is not > 100% aligned with the W3C specifications. > > > > First off XMLBeans complained about the well-formed XML unless there > was a default namespace declaration – even though technically – one > should not be needed (there’s no namespace prefixes used). > > > > Upon deeper inspection I found that this was being triggered by what > was defined in the schema used to do the XMLBeans generation. > > > > It appears that XMLBeans locks the default namespace declaration into > what it generates to be explicitly that URL from the schema. > > > > Again this is not 100% kosher – since the well-formed XML should be > allowed to define the namespace without the URL for the declaration > having any special significance. > > > > I can understand WHY the XMLBeans is doing this – its using it as an > unofficial “version” marker – but I’m asking if there is a way to turn > this behaviour off? > > > > Reason is that I fully expect people that start working with our > well-formed XML to want to REPLACE the URL in that default namespace > declaration with their own URL – not ours. And technically by the W3C > – they should be able to. > > > > Thanks, DW > > > > > ______________________________________________________________________ > From: Radu Preotiuc-Pietro [mailto:[EMAIL PROTECTED] > Sent: Friday, November 17, 2006 9:46 PM > To: [email protected] > Subject: RE: Accepting any URL on the default namespace declaration > > > > > Let me see if I got this straight. You want that regardless of the > namespace in the document, XmlBeans to consider it as having no > namespace at all. If this is correct, I have to say I find it pretty > strange. You can do two things: > > > > 1. Try using .setLoadUseXMLReader() and pass in a Reader that doesn't > use namespaces > > 2. Write a SAX filter that strips the namespace before passing the > events to XMLBeans; this is not as difficult as it may sound. > > > > I suppose that we could always add an option for XMLBeans to do this > automatically; but first, is this a good characterization of what you > had in mind? > > > > Radu > > > > > ______________________________________________________________________ > From: Webber, David (NIH/OD) [C] [mailto:[EMAIL PROTECTED] > Sent: Thursday, November 16, 2006 9:01 AM > To: [email protected] > Subject: Accepting any URL on the default namespace declaration > > Just trying to puzzle out the XmlOptions for the Factory.parse – the > FAQ and the Javadoc gives some parameters – but no guide to their > usage / purpose. Not always clear from the name of the parameter. > > > > What I’m attempting to do is to have the namespace declaration URL be > ##any – instead of enforced to be a specific URL value. > > > > E.g. > > > > <myxml xmlns=”foobar.com/mustbe/this/that”> > > <test/> > > </myxml> > > > > Where the namespace URL is forced to match the value put in > targetNamesSpace in the XSD that was used to generate the XMLBeans. > > > > I want to relax that check and allow any URL to be used for the > default namespace. > > > > Thanks, > > > > David Webber > > > > http://drrw.net > > > > > _______________________________________________________________________ > Notice: This email message, together with any attachments, may contain > information of BEA Systems, Inc., its subsidiaries and affiliated > entities, that may be confidential, proprietary, copyrighted and/or > legally privileged, and is intended solely for the use of the individual > or entity named in this message. If you are not the intended recipient, > and have received this message in error, please immediately return this > by email and then delete it. _______________________________________________________________________ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

